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/SemaTemplateInstantiateExpr.cpp b/lib/Sema/SemaTemplateInstantiateExpr.cpp
index 5e91ada..ca19a3d 100644
--- a/lib/Sema/SemaTemplateInstantiateExpr.cpp
+++ b/lib/Sema/SemaTemplateInstantiateExpr.cpp
@@ -469,22 +469,8 @@
Sema::OwningExprResult
TemplateExprInstantiator::VisitTypesCompatibleExpr(TypesCompatibleExpr *E) {
- QualType Type1 = SemaRef.InstantiateType(E->getArgType1(), TemplateArgs,
- /*FIXME:*/ E->getBuiltinLoc(),
- DeclarationName());
- if (Type1.isNull())
- return SemaRef.ExprError();
-
- QualType Type2 = SemaRef.InstantiateType(E->getArgType2(), TemplateArgs,
- /*FIXME:*/ E->getBuiltinLoc(),
- DeclarationName());
- if (Type2.isNull())
- return SemaRef.ExprError();
-
- return SemaRef.ActOnTypesCompatibleExpr(E->getBuiltinLoc(),
- Type1.getAsOpaquePtr(),
- Type2.getAsOpaquePtr(),
- E->getRParenLoc());
+ assert(false && "__builtin_types_compatible_p is not legal in C++");
+ return SemaRef.ExprError();
}
Sema::OwningExprResult