This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55588] Failure to diagnose non-template-id prefixed by keyword template
- 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: Tue, 04 Dec 2012 09:14:02 +0000
- Subject: [Bug c++/55588] Failure to diagnose non-template-id prefixed by keyword template
- Auto-submitted: auto-generated
- References: <bug-55588-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55588
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-12-04 09:14:02 UTC ---
I should have added an instantiation of the function to the code:
template <class T> struct A {
void f(int);
template <class U> void f(U);
};
template <class T> void f(T t) {
A<T> a;
a.template f<>(t); // OK: calls template
a.template f(t); // error: not a template-id
}
int main() {
f(1);
}