Browse Source

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
Richard Smith 6 years ago
parent
commit
e8151ca3d9

+ 2 - 1
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<FunctionTemplateDecl>(*I), FoundDecl, ExplicitTemplateArgs, Args,

+ 21 - 0
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