]> granicus.if.org Git - clang/commitdiff
Relax assertion since non-pod C++ classes are not aggregates, but still can appear...
authorTed Kremenek <kremenek@apple.com>
Fri, 25 Jun 2010 23:51:38 +0000 (23:51 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 25 Jun 2010 23:51:38 +0000 (23:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106919 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/GRExprEngine.cpp

index 4c2512dfa4e966497eec2c4f4bb637d8363572c2..0519c0f79c7c7adb211573c1f30fb44c28054477 100644 (file)
@@ -1059,16 +1059,21 @@ void GRExprEngine::VisitLValue(Expr* Ex, ExplodedNode* Pred,
       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);
+    }
   }
 }