From 389cecc83f33e93c8ba6bf2e8269b8690404416f Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Thu, 2 Aug 2007 00:13:27 +0000 Subject: [PATCH] Hack Expr::isConstantExpr() to allow for __builtin_types_compatible_p. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40705 91177308-0d34-0410-b5e6-96231b3b80d8 --- AST/Expr.cpp | 3 +++ include/clang/AST/Expr.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AST/Expr.cpp b/AST/Expr.cpp index 5fcd31a590..8f1335c333 100644 --- a/AST/Expr.cpp +++ b/AST/Expr.cpp @@ -305,6 +305,9 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx, Result.setIsUnsigned(!getType()->isSignedIntegerType()); break; } + case TypesCompatibleExprClass: + Result = cast(this)->typesAreCompatible(); + break; case DeclRefExprClass: if (const EnumConstantDecl *D = dyn_cast(cast(this)->getDecl())) { diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 0e3ea58967..ada076dc74 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -738,7 +738,7 @@ public: QualType getArgType1() { return Type1; } QualType getArgType2() { return Type2; } - int typesAreCompatible() { return Type::typesAreCompatible(Type1,Type2); } + int typesAreCompatible() const { return Type::typesAreCompatible(Type1,Type2); } virtual SourceRange getSourceRange() const { return SourceRange(BuiltinLoc, RParenLoc); -- 2.50.1