forked from OSchip/llvm-project
PR11391: Don't try to evaluate the LHS of a _Complex assignment as an rvalue.
llvm-svn: 144799
This commit is contained in:
parent
0ca7ce389c
commit
10f4d06b81
|
@ -3695,10 +3695,14 @@ bool ComplexExprEvaluator::VisitCastExpr(const CastExpr *E) {
|
|||
}
|
||||
|
||||
bool ComplexExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {
|
||||
if (E->isPtrMemOp() || E->isAssignmentOp())
|
||||
return ExprEvaluatorBaseTy::VisitBinaryOperator(E);
|
||||
|
||||
if (E->getOpcode() == BO_Comma) {
|
||||
VisitIgnoredValue(E->getLHS());
|
||||
return Visit(E->getRHS());
|
||||
}
|
||||
|
||||
if (!Visit(E->getLHS()))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -108,3 +108,7 @@ int literalVsNull2 = 0 == "foo";
|
|||
|
||||
// PR11385.
|
||||
int castViaInt[*(int*)(unsigned long)"test"]; // expected-error {{variable length array}}
|
||||
|
||||
// PR11391.
|
||||
struct PR11391 { _Complex float f; } pr11391;
|
||||
EVAL_EXPR(42, __builtin_constant_p(pr11391.f = 1))
|
||||
|
|
Loading…
Reference in New Issue