From: Chris Lattner Date: Thu, 23 Aug 2007 21:42:50 +0000 (+0000) Subject: sizeof(x) doesn't require x to be an i-c-e for sizeof to be an i-c-e. Thanks to... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=602dafdea34b78c7bc1f4601f94062afa4139e76;p=clang sizeof(x) doesn't require x to be an i-c-e for sizeof to be an i-c-e. Thanks to Neil for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41338 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/AST/Expr.cpp b/AST/Expr.cpp index 7397e54ae6..8701b9bb06 100644 --- a/AST/Expr.cpp +++ b/AST/Expr.cpp @@ -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()) {