Assume statement expressions have side effects; this gets rid of a lot
of extra warnings in the Python source. llvm-svn: 51594
This commit is contained in:
parent
ca5bdef66a
commit
824f8c12fd
|
@ -319,14 +319,17 @@ bool Expr::hasLocalSideEffect() const {
|
||||||
// If the base pointer or element is to a volatile pointer/field, accessing
|
// If the base pointer or element is to a volatile pointer/field, accessing
|
||||||
// if is a side effect.
|
// if is a side effect.
|
||||||
return getType().isVolatileQualified();
|
return getType().isVolatileQualified();
|
||||||
|
|
||||||
case CallExprClass:
|
case CallExprClass:
|
||||||
// TODO: check attributes for pure/const. "void foo() { strlen("bar"); }"
|
// TODO: check attributes for pure/const. "void foo() { strlen("bar"); }"
|
||||||
// should warn.
|
// should warn.
|
||||||
return true;
|
return true;
|
||||||
case ObjCMessageExprClass:
|
case ObjCMessageExprClass:
|
||||||
return true;
|
return true;
|
||||||
|
case StmtExprClass:
|
||||||
|
// TODO: check the inside of the statement expression
|
||||||
|
return true;
|
||||||
|
|
||||||
case CastExprClass:
|
case CastExprClass:
|
||||||
// If this is a cast to void, check the operand. Otherwise, the result of
|
// If this is a cast to void, check the operand. Otherwise, the result of
|
||||||
// the cast is unused.
|
// the cast is unused.
|
||||||
|
|
Loading…
Reference in New Issue