Relax assertion since non-pod C++ classes are not aggregates, but still can appear in this context.

llvm-svn: 106919
This commit is contained in:
Ted Kremenek 2010-06-25 23:51:38 +00:00
parent a2a27d65a5
commit 58f61ec1de
1 changed files with 9 additions and 4 deletions

View 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);
}
}
}