]> granicus.if.org Git - clang/commitdiff
sizeof(x) doesn't require x to be an i-c-e for sizeof to be an i-c-e. Thanks to...
authorChris Lattner <sabre@nondot.org>
Thu, 23 Aug 2007 21:42:50 +0000 (21:42 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 23 Aug 2007 21:42:50 +0000 (21:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41338 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Expr.cpp

index 7397e54ae6ac56948bc16f4b36ef5ac7c7b14d18..8701b9bb069e6e800089978da4d2868babcc5cb5 100644 (file)
@@ -401,8 +401,8 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx,
     
     // Get the operand value.  If this is sizeof/alignof, do not evalute the
     // operand.  This affects C99 6.6p3.
-    if (Exp->isSizeOfAlignOfOp()) isEvaluated = false;
-    if (!Exp->getSubExpr()->isIntegerConstantExpr(Result, Ctx,Loc, isEvaluated))
+    if (!Exp->isSizeOfAlignOfOp() &&
+        !Exp->getSubExpr()->isIntegerConstantExpr(Result, Ctx, Loc,isEvaluated))
       return false;
 
     switch (Exp->getOpcode()) {