forked from OSchip/llvm-project
[analyzer] Array CompoundLiteralExprs need to be treated like lvalues.
llvm-svn: 158588
This commit is contained in:
parent
e42412be39
commit
b4712d142a
|
@ -408,7 +408,7 @@ void ExprEngine::VisitCompoundLiteralExpr(const CompoundLiteralExpr *CL,
|
|||
const LocationContext *LC = Pred->getLocationContext();
|
||||
state = state->bindCompoundLiteral(CL, LC, ILV);
|
||||
|
||||
if (CL->isGLValue())
|
||||
if (CL->isGLValue() || CL->getType()->isArrayType())
|
||||
B.generateNode(CL, Pred, state->BindExpr(CL, LC, state->getLValue(CL, LC)));
|
||||
else
|
||||
B.generateNode(CL, Pred, state->BindExpr(CL, LC, ILV));
|
||||
|
|
|
@ -70,3 +70,8 @@ void vla(int n) {
|
|||
clang_analyzer_eval(structs[0].x == 1); // expected-warning{{TRUE}}
|
||||
}
|
||||
|
||||
void useIntArray(int []);
|
||||
void testIntArrayLiteral() {
|
||||
useIntArray((int []){ 1, 2, 3 });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue