Fix assertion in constant expression evaluation. The LHS of a floating-point

binary operator isn't an rvalue if it's an assignment operator.

llvm-svn: 143250
This commit is contained in:
Richard Smith 2011-10-28 23:26:52 +00:00
parent c6674fd597
commit 472d495372
2 changed files with 4 additions and 2 deletions

View File

@ -2492,8 +2492,8 @@ bool FloatExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {
return Visit(E->getRHS());
}
// We can't evaluate pointer-to-member operations.
if (E->isPtrMemOp())
// We can't evaluate pointer-to-member operations or assignments.
if (E->isPtrMemOp() || E->isAssignmentOp())
return false;
// FIXME: Diagnostics? I really don't understand how the warnings

View File

@ -86,3 +86,5 @@ void rdar8875946() {
double _Complex P;
float _Complex P2 = 3.3f + P;
}
double d = (d = 0.0); // expected-error {{not a compile-time constant}}