The compiler does not reject the following: struct A{ void f(){} }; struct B{ static A& n(){ return *new A(); } }; template <typename T> struct C{ void g(){ T::n().template f(); } }; int main(){ (new C<B>())->g(); } Function A::f is not template.
Dup of bug 55588. *** This bug has been marked as a duplicate of bug 55588 ***