summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-19 22:28:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-19 22:28:02 +0000
commitf907cbf6341aeba30ea1cd81937e839d1fb091a6 (patch)
tree200c97e7f5afbf67f5830edde3bbfbde6e2b7529 /clang/lib/Sema/SemaExpr.cpp
parent8cf4718fcd7b510833840a7aeab51ccf633cbd34 (diff)
downloadbcm5719-llvm-f907cbf6341aeba30ea1cd81937e839d1fb091a6.tar.gz
bcm5719-llvm-f907cbf6341aeba30ea1cd81937e839d1fb091a6.zip
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! llvm-svn: 72142
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 3f99c684b89..bb85455ddca 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -5022,6 +5022,12 @@ Sema::OwningExprResult Sema::ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
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));
}
OpenPOWER on IntegriCloud