diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 27943d5d3f..73c19a755b 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -3306,10 +3306,6 @@ void Sema::CodeCompleteCall(Scope *S, ExprTy *FnIn, llvm::SmallVector Results; Expr *NakedFn = Fn->IgnoreParenCasts(); - if (UnaryOperator *UnOp = dyn_cast(NakedFn)) - if (UnOp->getOpcode() == UO_AddrOf) - NakedFn = UnOp->getSubExpr()->IgnoreParens(); - if (UnresolvedLookupExpr *ULE = dyn_cast(NakedFn)) AddOverloadedCallCandidates(ULE, Args, NumArgs, CandidateSet, /*PartialOverloading=*/ true); diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index f404c20b41..0d0f48cd74 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -3781,15 +3781,17 @@ Sema::ActOnCallExpr(Scope *S, Expr *Fn, SourceLocation LParenLoc, // lookup and whether there were any explicitly-specified template arguments. Expr *NakedFn = Fn->IgnoreParens(); + if (isa(NakedFn)) { + UnresolvedLookupExpr *ULE = cast(NakedFn); + return BuildOverloadedCallExpr(S, Fn, ULE, LParenLoc, Args, NumArgs, + RParenLoc); + } + NamedDecl *NDecl = 0; if (UnaryOperator *UnOp = dyn_cast(NakedFn)) if (UnOp->getOpcode() == UO_AddrOf) NakedFn = UnOp->getSubExpr()->IgnoreParens(); - if (UnresolvedLookupExpr *ULE = dyn_cast(NakedFn)) - return BuildOverloadedCallExpr(S, Fn, ULE, LParenLoc, Args, NumArgs, - RParenLoc); - if (isa(NakedFn)) NDecl = cast(NakedFn)->getDecl(); diff --git a/test/CodeCompletion/call.cpp b/test/CodeCompletion/call.cpp index 65b1cf1f2b..f06470f4cb 100644 --- a/test/CodeCompletion/call.cpp +++ b/test/CodeCompletion/call.cpp @@ -17,14 +17,12 @@ void f(); void test() { f(Y(), 0, 0); - (&f)(Y(), 0, 0); - // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s + // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CC1 %s // CHECK-CC1: COMPLETION: Pattern : dynamic_cast<<#type#>>(<#expression#>) // CHECK-CC1: f(N::Y y, <#int ZZ#>) // CHECK-CC1-NEXT: f(int i, <#int j#>, int k) // CHECK-CC1-NEXT: f(float x, <#float y#>) - // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:13 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s + // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:13 %s -o - | FileCheck -check-prefix=CC2 %s // CHECK-CC2-NOT: f(N::Y y, int ZZ) // CHECK-CC2: f(int i, int j, <#int k#>) } - // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:20:16 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s diff --git a/test/SemaCXX/overload-call.cpp b/test/SemaCXX/overload-call.cpp index 7aeb9522f1..81a88a3a9a 100644 --- a/test/SemaCXX/overload-call.cpp +++ b/test/SemaCXX/overload-call.cpp @@ -503,11 +503,3 @@ namespace rdar8499524 { g(W()); } } - -namespace PR8013 { - void f(int,int); - void f(int,int,int); - void g() { - (&f)(1,2,3); - } -}