]> granicus.if.org Git - clang/commitdiff
Hack Expr::isConstantExpr() to allow for __builtin_types_compatible_p.
authorSteve Naroff <snaroff@apple.com>
Thu, 2 Aug 2007 00:13:27 +0000 (00:13 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 2 Aug 2007 00:13:27 +0000 (00:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40705 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Expr.cpp
include/clang/AST/Expr.h

index 5fcd31a59090db79cc499f71c28234c177b6633f..8f1335c33386388628e1bc1fc6ac6822ef256246 100644 (file)
@@ -305,6 +305,9 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx,
     Result.setIsUnsigned(!getType()->isSignedIntegerType());
     break;
   }
+  case TypesCompatibleExprClass:
+    Result = cast<TypesCompatibleExpr>(this)->typesAreCompatible();
+    break;
   case DeclRefExprClass:
     if (const EnumConstantDecl *D = 
           dyn_cast<EnumConstantDecl>(cast<DeclRefExpr>(this)->getDecl())) {
index 0e3ea58967fa1609d4df29356c6bc9e2d8870cdf..ada076dc741d2b391defac7ae43eee9cb131cfba 100644 (file)
@@ -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);