зеркало из https://github.com/microsoft/clang-1.git
PR11391: Don't try to evaluate the LHS of a _Complex assignment as an rvalue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144799 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
261e75bd10
Коммит
2ad226bdc8
|
@ -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))
|
||||
|
|
Загрузка…
Ссылка в новой задаче