[Bug c++/20906] excessive diagnostic messages for missing template arguments

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 27 19:11:00 GMT 2016


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|excessive diagnostic        |excessive diagnostic
                   |messages                    |messages for missing
                   |                            |template arguments

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Clang:

prog.cc:3:34: error: use of class template 'bar' requires template arguments
template<int k> void foo<k>::pop(bar&, int) {}
                                 ^
prog.cc:1:22: note: template is declared here
template<int> struct bar {};
~~~~~~~~~~~~~        ^

I think we could do the same, since we get the right message. My guess is that
this error happens during tentative parsing, and when we abort it, we don't
skip the whole function declaration. We probably need to skip even the body,
otherwise we will get strange errors.


More information about the Gcc-bugs mailing list