From 472d4953727a2b4c508aa99e9f15e1229a44e91c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 28 Oct 2011 23:26:52 +0000 Subject: 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 --- clang/lib/AST/ExprConstant.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/AST/ExprConstant.cpp') diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 89bcacf2bba..6e2e15c6cb6 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -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 -- cgit v1.2.3