[cfe-commits] r106919 - /cfe/trunk/lib/Checker/GRExprEngine.cpp

Ted Kremenek kremenek at apple.com
Fri Jun 25 16:51:38 PDT 2010


Author: kremenek
Date: Fri Jun 25 18:51:38 2010
New Revision: 106919

URL: http://llvm.org/viewvc/llvm-project?rev=106919&view=rev
Log:
Relax assertion since non-pod C++ classes are not aggregates, but still can appear in this context.

Modified:
    cfe/trunk/lib/Checker/GRExprEngine.cpp

Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=106919&r1=106918&r2=106919&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Checker/GRExprEngine.cpp Fri Jun 25 18:51:38 2010
@@ -1059,16 +1059,21 @@
       CreateCXXTemporaryObject(Ex, Pred, Dst);
       return;
 
-    default:
+    default: {
       // Arbitrary subexpressions can return aggregate temporaries that
       // can be used in a lvalue context.  We need to enhance our support
       // of such temporaries in both the environment and the store, so right
       // now we just do a regular visit.
-      assert ((Ex->getType()->isAggregateType()) &&
-              "Other kinds of expressions with non-aggregate/union types do"
-              " not have lvalues.");
+
+      // NOTE: Do not use 'isAggregateType()' here as CXXRecordDecls that
+      //  are non-pod are not aggregates.
+      assert ((isa<RecordType>(Ex->getType().getDesugaredType()) ||
+               isa<ArrayType>(Ex->getType().getDesugaredType())) &&
+              "Other kinds of expressions with non-aggregate/union/class types"
+              " do not have lvalues.");
 
       Visit(Ex, Pred, Dst);
+    }
   }
 }
 





More information about the cfe-commits mailing list