This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55588] Failure to diagnose non-template-id prefixed by keyword template


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);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]