]> granicus.if.org Git - clang/commitdiff
Always build a builtin operator expression for the __extension__ unary operator.
authorAnders Carlsson <andersca@mac.com>
Sat, 14 Nov 2009 21:26:41 +0000 (21:26 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 14 Nov 2009 21:26:41 +0000 (21:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88811 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp
test/SemaCXX/overloaded-builtin-operators.cpp

index b311fda2d3c4f009c7b29f37b39ef4d5b1e7c34c..0d4ce609136f31c0f7e5857772e454ac7454c726 100644 (file)
@@ -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
index 89ac29adc7304211c3fb774ec04d5c19a347c053..fd0cbc6c8643602e97dfd292d9380fbfb0b2d0d7 100644 (file)
@@ -185,3 +185,6 @@ int test_pr5432() {
   return a[X][X];
 }
 
+void f() {
+  (void)__extension__(A());
+}