]> granicus.if.org Git - clang/commitdiff
Assume statement expressions have side effects; this gets rid of a lot
authorEli Friedman <eli.friedman@gmail.com>
Tue, 27 May 2008 15:24:04 +0000 (15:24 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 27 May 2008 15:24:04 +0000 (15:24 +0000)
of extra warnings in the Python source.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51594 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp

index e21686cf4ef10d92d50fd0e48bd0866b095ae0f4..d26ad1025d88e06618829c059e3fd7f659dbed0a 100644 (file)
@@ -319,14 +319,17 @@ bool Expr::hasLocalSideEffect() const {
     // If the base pointer or element is to a volatile pointer/field, accessing
     // if is a side effect.
     return getType().isVolatileQualified();
-    
+
   case CallExprClass:
     // TODO: check attributes for pure/const.   "void foo() { strlen("bar"); }"
     // should warn.
     return true;
   case ObjCMessageExprClass:
     return true;
-    
+  case StmtExprClass:
+    // TODO: check the inside of the statement expression
+    return true;
+
   case CastExprClass:
     // If this is a cast to void, check the operand.  Otherwise, the result of
     // the cast is unused.