[cfe-commits] r143360 - /cfe/trunk/lib/AST/ExprConstant.cpp

Richard Smith richard-llvm at metafoo.co.uk
Mon Oct 31 13:20:33 PDT 2011


Author: rsmith
Date: Mon Oct 31 15:20:33 2011
New Revision: 143360

URL: http://llvm.org/viewvc/llvm-project?rev=143360&view=rev
Log:
Temporary fix for assert while evaluating array-to-pointer decay on array
rvalue. Test and better fix to follow.

Modified:
    cfe/trunk/lib/AST/ExprConstant.cpp

Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=143360&r1=143359&r2=143360&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Mon Oct 31 15:20:33 2011
@@ -1223,7 +1223,9 @@
   }
   case CK_ArrayToPointerDecay:
   case CK_FunctionToPointerDecay:
-    return EvaluateLValue(SubExpr, Result, Info);
+    if (SubExpr->isGLValue() || SubExpr->getType()->isFunctionType())
+      return EvaluateLValue(SubExpr, Result, Info);
+    return Error(E);
   }
 
   return ExprEvaluatorBaseTy::VisitCastExpr(E);





More information about the cfe-commits mailing list