Fix assertion in constant expression evaluation. The LHS of a floating-point
binary operator isn't an rvalue if it's an assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143250 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 89bcacf..6e2e15c 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -2492,8 +2492,8 @@
     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
diff --git a/test/Sema/const-eval.c b/test/Sema/const-eval.c
index bdb40ae..6dcc6db 100644
--- a/test/Sema/const-eval.c
+++ b/test/Sema/const-eval.c
@@ -86,3 +86,5 @@
   double _Complex  P;
   float _Complex  P2 = 3.3f + P;
 }
+
+double d = (d = 0.0); // expected-error {{not a compile-time constant}}