I\'ve been playing with clang a while, and I stumbled upon \"test/SemaTemplate/dependent-template-recover.cpp\" (in the clang distribution) which is supposed to provide hint
Insert it just before the point where the caret is:
template struct X {
void f(T* t)
{
t->template f0();
}
};
Edit: the reason for this rule becomes clearer if you think like a compiler. Compilers generally only look ahead one or two tokens at once, and don't generally "look ahead" to the rest of the expression.[Edit: see comment] The reason for the keyword is the same as why you need the typename keyword to indicate dependent type names: it's telling the compiler "hey, the identifier you're about to see is the name of a template, rather than the name of a static data member followed by a less-than sign".