<div dir="ltr">Yeah, looks like a bug in Clang to me - CC'ing Richard Smith in case this is quick/easy/obvious to him. Here's my slightly modified test case comparing Clang and GCC's behavior, and adding a non-member overload situation to demonstrate that that works on both compilers: <a href="https://godbolt.org/z/cTq06R">https://godbolt.org/z/cTq06R</a> <br><br><div class="gmail_quote"><div dir="ltr">On Sat, Nov 3, 2018 at 3:19 PM Werner LEMBERG via cfe-users <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Folks,<br>
<br>
<br>
below is a MWE that compiles fine with g++ but fails with clang<br>
(tested version 6.0.1 on a GNU/Linux box):<br>
<br>
  clang-problem.cpp:19:7: error:<br>
      no matching member function for call to 'zip'<br>
    bex.zip <&B::fun> ();<br>
    ~~~~^~~~~~~~~~~~~<br>
  clang-problem.cpp:13:8: note: candidate template ignored:<br>
      invalid explicitly-specified argument for template parameter 'mf'<br>
    void zip () { }<br>
         ^<br>
<br>
To my best knowledge, the code is valid C++.  This means there are two<br>
possible corrolaries: either I'm wrong, and it is not valid C++<br>
according to the standard, or clang++ has a bug.  Hopefully, it's the<br>
former.<br>
<br>
Can you point out a solution?<br>
<br>
<br>
    Werner<br>
<br>
<br>
======================================================================<br>
<br>
<br>
class A {<br>
public:<br>
  template <void (A::*mf)()><br>
  void zip () { }<br>
  void fun () { }<br>
};<br>
<br>
class B : public A<br>
{<br>
public:<br>
  using A::zip; // Fails to involve A::zip in overloading resolution<br>
  template <void (B::*mf)()><br>
  void zip () { }<br>
} bex;<br>
<br>
<br>
void x ()<br>
{<br>
  bex.zip <&B::fun> ();<br>
}<br>
<br>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div></div>