]> granicus.if.org Git - clang/commitdiff
Use UnaryOperator as the representation of dependent expressions when
authorDouglas Gregor <dgregor@apple.com>
Thu, 17 Jun 2010 15:46:20 +0000 (15:46 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 17 Jun 2010 15:46:20 +0000 (15:46 +0000)
no overloaded operators were found in scope, mirroring what we already
do for BinaryOperator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106222 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOverload.cpp

index 4baa307890e92e79b78c10c973fbd08e31c3c0b2..001e951d9609df6d2650592880a1d1f0edfd945c 100644 (file)
@@ -6361,6 +6361,12 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, unsigned OpcIn,
   }
 
   if (Input->isTypeDependent()) {
+    if (Fns.empty())
+      return Owned(new (Context) UnaryOperator(input.takeAs<Expr>(),
+                                               Opc, 
+                                               Context.DependentTy,
+                                               OpLoc));
+    
     CXXRecordDecl *NamingClass = 0; // because lookup ignores member operators
     UnresolvedLookupExpr *Fn
       = UnresolvedLookupExpr::Create(Context, /*Dependent*/ true, NamingClass,