Author: ericwf Date: Tue Dec 11 08:53:25 2018 New Revision: 348864 URL: http://llvm.org/viewvc/llvm-project?rev=348864&view=rev Log: Pass PartialOverloading argument to the correct corresponding parameter
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp cfe/trunk/test/CodeCompletion/function-overloads.cpp Modified: cfe/trunk/lib/Sema/SemaOverload.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=348864&r1=348863&r2=348864&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaOverload.cpp (original) +++ cfe/trunk/lib/Sema/SemaOverload.cpp Tue Dec 11 08:53:25 2018 @@ -8939,12 +8939,14 @@ Sema::AddArgumentDependentLookupCandidat if (ExplicitTemplateArgs) continue; - AddOverloadCandidate(FD, FoundDecl, Args, CandidateSet, false, + AddOverloadCandidate(FD, FoundDecl, Args, CandidateSet, + /*SupressUserConversions=*/false, PartialOverloading); - } else - AddTemplateOverloadCandidate(cast<FunctionTemplateDecl>(*I), - FoundDecl, ExplicitTemplateArgs, - Args, CandidateSet, PartialOverloading); + } else { + AddTemplateOverloadCandidate( + cast<FunctionTemplateDecl>(*I), FoundDecl, ExplicitTemplateArgs, Args, + CandidateSet, /*SupressUserConversions=*/false, PartialOverloading); + } } } Modified: cfe/trunk/test/CodeCompletion/function-overloads.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeCompletion/function-overloads.cpp?rev=348864&r1=348863&r2=348864&view=diff ============================================================================== --- cfe/trunk/test/CodeCompletion/function-overloads.cpp (original) +++ cfe/trunk/test/CodeCompletion/function-overloads.cpp Tue Dec 11 08:53:25 2018 @@ -10,12 +10,27 @@ void test() { A a(f(1, 2, 3, 4), 2, 3); } + +namespace NS { + struct X { }; + struct Y { Y(X); }; + template <class T = int> + void g(X, Y); +} + +void test_adl() { + NS::X x; + g(x, x); +} + // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:10 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:17 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:19 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:20 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:21 %s -o - | FileCheck -check-prefix=CHECK-CC4 %s +// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:23:7 %s -o - | \ +// RUN: FileCheck -check-prefix=CHECK-CC5 %s // CHECK-CC1: OVERLOAD: [#int#]f(<#float x#>, float y) // CHECK-CC1: OVERLOAD: [#int#]f(<#int i#>) // CHECK-CC1-NOT, CHECK-CC2-NOT: OVERLOAD: A( @@ -25,3 +40,4 @@ void test() { // CHECK-CC3: OVERLOAD: A(<#const A &#>) // CHECK-CC3: OVERLOAD: A(<#A &&#>) // CHECK-CC4: OVERLOAD: A(int, <#int#>, int) +// CHECK-CC5: OVERLOAD: [#void#]g(X, <#Y#>) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits