<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I minimized the reproducer. Seems like base class template methods are not included in derived object method name resolution.<div class=""><br class=""></div><div class="">Knowing whether it violates the standard or not is beyond my knowledge though.<br class=""><div class=""><br class=""></div><div class="">type params</div><div class=""><a href="https://godbolt.org/z/WpET78" class="">https://godbolt.org/z/WpET78</a></div><div class=""><br class=""></div><div class="">nontype params</div><div class=""><a href="https://godbolt.org/z/PZIaDn" class="">https://godbolt.org/z/PZIaDn</a></div><div class=""><br class=""></div><div class="">Jan<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 5, 2018, at 4:36 PM, David Blaikie via cfe-users <<a href="mailto:cfe-users@lists.llvm.org" class="">cfe-users@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">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" class="">https://godbolt.org/z/cTq06R</a> <br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sat, Nov 3, 2018 at 3:19 PM Werner LEMBERG via cfe-users <<a href="mailto:cfe-users@lists.llvm.org" class="">cfe-users@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
Folks,<br class="">
<br class="">
<br class="">
below is a MWE that compiles fine with g++ but fails with clang<br class="">
(tested version 6.0.1 on a GNU/Linux box):<br class="">
<br class="">
clang-problem.cpp:19:7: error:<br class="">
no matching member function for call to 'zip'<br class="">
bex.zip <&B::fun> ();<br class="">
~~~~^~~~~~~~~~~~~<br class="">
clang-problem.cpp:13:8: note: candidate template ignored:<br class="">
invalid explicitly-specified argument for template parameter 'mf'<br class="">
void zip () { }<br class="">
^<br class="">
<br class="">
To my best knowledge, the code is valid C++. This means there are two<br class="">
possible corrolaries: either I'm wrong, and it is not valid C++<br class="">
according to the standard, or clang++ has a bug. Hopefully, it's the<br class="">
former.<br class="">
<br class="">
Can you point out a solution?<br class="">
<br class="">
<br class="">
Werner<br class="">
<br class="">
<br class="">
======================================================================<br class="">
<br class="">
<br class="">
class A {<br class="">
public:<br class="">
template <void (A::*mf)()><br class="">
void zip () { }<br class="">
void fun () { }<br class="">
};<br class="">
<br class="">
class B : public A<br class="">
{<br class="">
public:<br class="">
using A::zip; // Fails to involve A::zip in overloading resolution<br class="">
template <void (B::*mf)()><br class="">
void zip () { }<br class="">
} bex;<br class="">
<br class="">
<br class="">
void x ()<br class="">
{<br class="">
bex.zip <&B::fun> ();<br class="">
}<br class="">
<br class="">
_______________________________________________<br class="">
cfe-users mailing list<br class="">
<a href="mailto:cfe-users@lists.llvm.org" target="_blank" class="">cfe-users@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br class="">
</blockquote></div></div>
_______________________________________________<br class="">cfe-users mailing list<br class=""><a href="mailto:cfe-users@lists.llvm.org" class="">cfe-users@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users<br class=""></div></blockquote></div><br class=""></div></div></body></html>