forked from OSchip/llvm-project
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:
parent
c6674fd597
commit
472d495372
|
@ -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
|
||||
|
|
|
@ -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}}
|
||||
|
|
Loading…
Reference in New Issue