Fix regression in r360311 caused by reversed bool arguments.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 16 May 2019 02:06:16 +0000 (02:06 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 16 May 2019 02:06:16 +0000 (02:06 +0000)
llvm-svn: 360837

clang/lib/Sema/SemaOverload.cpp
clang/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp [new file with mode: 0644]

index 74283a0..256c234 100644 (file)
@@ -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,
diff --git a/clang/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp b/clang/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp
new file mode 100644 (file)
index 0000000..e5b3607
--- /dev/null
@@ -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