This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/68842] Better error output when template needed before dependent name
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Dec 2015 11:30:30 +0000
- Subject: [Bug c++/68842] Better error output when template needed before dependent name
- Auto-submitted: auto-generated
- References: <bug-68842-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68842
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-12-11
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
N.B. GCC 4.8 is no longer supported and the branch is closed, but the
diagnostic is the same in current releases, and I agree a "fix-it" hint would
be better than the current error.
Clang gives a different error, which IMHO is even less helpful despite trying
to give a fix-it hint:
tt.cc:15:5: error: reference to non-static member function must be called
t.do_nothing<N>(0);
~~^~~~~~~~~~
tt.cc:20:3: note: in instantiation of function template specialization
'do_test<2>' requested here
do_test<2>();
^
tt.cc:5:8: note: possible target for call
void do_nothing(int value)
^
1 error generated.