From: Richard Smith Date: Thu, 16 May 2019 02:06:16 +0000 (+0000) Subject: Fix regression in r360311 caused by reversed bool arguments. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8151ca3d9c9ec616c03bf96fc70716b60189b47;p=clang Fix regression in r360311 caused by reversed bool arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360837 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 74283a067c..256c2343e5 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -9003,8 +9003,9 @@ Sema::AddArgumentDependentLookupCandidates(DeclarationName Name, AddOverloadCandidate(FD, FoundDecl, Args, CandidateSet, /*SupressUserConversions=*/false, PartialOverloading, + /*AllowExplicit*/ true, /*AllowExplicitConversions*/ false, - /*AllowExplicit*/ true, ADLCallKind::UsesADL); + ADLCallKind::UsesADL); } else { AddTemplateOverloadCandidate( cast(*I), FoundDecl, ExplicitTemplateArgs, Args, diff --git a/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp b/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp new file mode 100644 index 0000000000..e5b3607fda --- /dev/null +++ b/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 %s -verify +// expected-no-diagnostics + +namespace r360311_regression { + struct string {}; + struct string_view { + explicit operator string() const; + }; + + namespace ns { + struct Base {}; + class Derived : public Base {}; + void f(string_view s, Base *c); + void f(const string &s, Derived *c); + } // namespace ns + + void g(string_view s) { + ns::Derived d; + f(s, &d); + } + } // namespace r360311_regression