From 9568880c3ec3f97d8b24a68b00d6fa13a336e2d6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 23 Aug 2007 21:42:50 +0000 Subject: [PATCH] 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. llvm-svn: 41338 --- clang/AST/Expr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/AST/Expr.cpp b/clang/AST/Expr.cpp index 7397e54ae6ac..8701b9bb069e 100644 --- a/clang/AST/Expr.cpp +++ b/clang/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()) {