aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-11-14 21:26:41 +0000
committerAnders Carlsson <andersca@mac.com>2009-11-14 21:26:41 +0000
commita8a1e3da7cc741ab36be18041fafbebdc9be826b (patch)
tree1e40918ec617d2a7b848fce381ca07a4f58188aa
parent658e8123a80d0e62f227a0c1532f2a4f106b3e73 (diff)
Always build a builtin operator expression for the __extension__ unary operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88811 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaExpr.cpp3
-rw-r--r--test/SemaCXX/overloaded-builtin-operators.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index b311fda2d3..0d4ce60913 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -5711,7 +5711,8 @@ Action::OwningExprResult Sema::BuildUnaryOp(Scope *S, SourceLocation OpLoc,
UnaryOperator::Opcode Opc,
ExprArg input) {
Expr *Input = (Expr*)input.get();
- if (getLangOptions().CPlusPlus && Input->getType()->isOverloadableType()) {
+ if (getLangOptions().CPlusPlus && Input->getType()->isOverloadableType() &&
+ Opc != UnaryOperator::Extension) {
// Find all of the overloaded operators visible from this
// point. We perform both an operator-name lookup from the local
// scope and an argument-dependent lookup based on the types of
diff --git a/test/SemaCXX/overloaded-builtin-operators.cpp b/test/SemaCXX/overloaded-builtin-operators.cpp
index 89ac29adc7..fd0cbc6c86 100644
--- a/test/SemaCXX/overloaded-builtin-operators.cpp
+++ b/test/SemaCXX/overloaded-builtin-operators.cpp
@@ -185,3 +185,6 @@ int test_pr5432() {
return a[X][X];
}
+void f() {
+ (void)__extension__(A());
+}