]> granicus.if.org Git - clang/commitdiff
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)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360837 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 74283a067cfce072ffdf871dae658e473cbeb617..256c2343e5175073a56e6d1d73cdcbd52f1bd583 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/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 (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