r360837 - Fix regression in r360311 caused by reversed bool arguments.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed May 15 19:06:17 PDT 2019


Author: rsmith
Date: Wed May 15 19:06:16 2019
New Revision: 360837

URL: http://llvm.org/viewvc/llvm-project?rev=360837&view=rev
Log:
Fix regression in r360311 caused by reversed bool arguments.

Added:
    cfe/trunk/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp
Modified:
    cfe/trunk/lib/Sema/SemaOverload.cpp

Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=360837&r1=360836&r2=360837&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Wed May 15 19:06:16 2019
@@ -9003,8 +9003,9 @@ Sema::AddArgumentDependentLookupCandidat
 
       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,

Added: cfe/trunk/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp?rev=360837&view=auto
==============================================================================
--- cfe/trunk/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp (added)
+++ cfe/trunk/test/CXX/over/over.match/over.match.funcs/over.match.ref/p1.cpp Wed May 15 19:06:16 2019
@@ -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




More information about the cfe-commits mailing list