From: Steve Naroff Date: Thu, 2 Aug 2007 04:09:23 +0000 (+0000) Subject: Tweak to Expr::isIntegerConstantExpr...make sure the result is appropriately size... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b658aa315784fa489a32daeacfe400512ce468d;p=clang Tweak to Expr::isIntegerConstantExpr...make sure the result is appropriately size for TypesCompatibleExpr's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40716 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/AST/Expr.cpp b/AST/Expr.cpp index 8f1335c333..44e8271bdb 100644 --- a/AST/Expr.cpp +++ b/AST/Expr.cpp @@ -305,9 +305,12 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx, Result.setIsUnsigned(!getType()->isSignedIntegerType()); break; } - case TypesCompatibleExprClass: - Result = cast(this)->typesAreCompatible(); + case TypesCompatibleExprClass: { + const TypesCompatibleExpr *TCE = cast(this); + Result.zextOrTrunc(Ctx.getTypeSize(getType(), TCE->getLocStart())); + Result = TCE->typesAreCompatible(); break; + } case DeclRefExprClass: if (const EnumConstantDecl *D = dyn_cast(cast(this)->getDecl())) {