Ban the use of __builtin_types_compatible_p in C++; g++ doesn't support it,
and it isn't clear exactly what it's supposed to mean. Thanks Eli!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72142 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 3f99c68..bb85455 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -5022,6 +5022,12 @@
 
   assert((!argT1.isNull() && !argT2.isNull()) && "Missing type argument(s)");
 
+  if (getLangOptions().CPlusPlus) {
+    Diag(BuiltinLoc, diag::err_types_compatible_p_in_cplusplus)
+      << SourceRange(BuiltinLoc, RPLoc);
+    return ExprError();
+  }
+
   return Owned(new (Context) TypesCompatibleExpr(Context.IntTy, BuiltinLoc,
                                                  argT1, argT2, RPLoc));
 }