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
diff --git a/AST/Expr.cpp b/AST/Expr.cpp
index 5fcd31a..8f1335c 100644
--- a/AST/Expr.cpp
+++ b/AST/Expr.cpp
@@ -305,6 +305,9 @@
     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())) {
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index 0e3ea58..ada076d 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -738,7 +738,7 @@
   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);