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 8f1335c..44e8271 100644
--- a/AST/Expr.cpp
+++ b/AST/Expr.cpp
@@ -305,9 +305,12 @@
Result.setIsUnsigned(!getType()->isSignedIntegerType());
break;
}
- case TypesCompatibleExprClass:
- Result = cast<TypesCompatibleExpr>(this)->typesAreCompatible();
+ case TypesCompatibleExprClass: {
+ const TypesCompatibleExpr *TCE = cast<TypesCompatibleExpr>(this);
+ Result.zextOrTrunc(Ctx.getTypeSize(getType(), TCE->getLocStart()));
+ Result = TCE->typesAreCompatible();
break;
+ }
case DeclRefExprClass:
if (const EnumConstantDecl *D =
dyn_cast<EnumConstantDecl>(cast<DeclRefExpr>(this)->getDecl())) {