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
This commit is contained in:
Chris Lattner 2007-08-23 21:42:50 +00:00
parent 9aae513318
commit 9568880c3e
1 changed files with 2 additions and 2 deletions

View 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()) {