[cfe-commits] r44889 - /cfe/trunk/AST/Expr.cpp

Chris Lattner sabre at nondot.org
Tue Dec 11 15:11:18 PST 2007


Author: lattner
Date: Tue Dec 11 17:11:17 2007
New Revision: 44889

URL: http://llvm.org/viewvc/llvm-project?rev=44889&view=rev
Log:
Fix a case where we'd return "is not a constant expr" without
return a location.

Modified:
    cfe/trunk/AST/Expr.cpp

Modified: cfe/trunk/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Expr.cpp?rev=44889&r1=44888&r2=44889&view=diff

==============================================================================
--- cfe/trunk/AST/Expr.cpp (original)
+++ cfe/trunk/AST/Expr.cpp Tue Dec 11 17:11:17 2007
@@ -443,8 +443,13 @@
     const UnaryOperator *Exp = cast<UnaryOperator>(this);
     
     // C99 6.6p9
-    if (Exp->getOpcode() == UnaryOperator::AddrOf)
-      return Exp->getSubExpr()->hasStaticStorage();
+    if (Exp->getOpcode() == UnaryOperator::AddrOf) {
+      if (!Exp->getSubExpr()->hasStaticStorage()) {
+        if (Loc) *Loc = getLocStart();
+        return false;
+      }
+      return true;
+    }
 
     // Get the operand value.  If this is sizeof/alignof, do not evalute the
     // operand.  This affects C99 6.6p3.





More information about the cfe-commits mailing list