https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66439

            Bug ID: 66439
           Summary: Diagnostic on failed function template lookup is
                    missing a line
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unmobile at gmail dot com
  Target Milestone: ---

Created attachment 35705
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35705&action=edit
Test input

When compiling the attached code, I get a pretty messed-up diagnostic that is
both less than fully informative and suggests there's supposed to be more
output, but doesn't print any:

>    $ g++-5 -c  adltest.cpp 
>    adltest.cpp: In function ‘void g(A::B)’:
>    adltest.cpp:11:12: error: no matching function for call to ‘f(A::B&)’
>       C::f<3>(b); //ill-formed; argument dependent lookup
>                ^
>    adltest.cpp:6:26: note: candidate: template<class T> void C::f(T)
>       template<class T> void f(T t);
>                              ^
>    adltest.cpp:6:26: note:   template argument deduction/substitution failed:

(note the trailing colon ':' on the last line)

This came to light when I tried to compile the code from
http://stackoverflow.com/questions/2953684/why-doesnt-adl-find-function-templates
and saw this trailed-off report. Really, the diagnostic should report more
explicitly what's going on, that C::f isn't a valid binding because the
template parameter '3' doesn't match up with the class parameter C::f expects.

Reply via email to