// PR c++/56749 // { dg-require-effective-target c++11 } enum normal_enum { not_scoped1, not_scoped2 }; enum class scoped_enum { scoped1, scoped2 }; template class A { public: template void fun () { } }; template class B { public: template void fun () { } }; template void tfun () { A<> a; a.fun(); //<------------ THIS IS FINE B<> b_defaulted; B b_explicited; b_defaulted.fun(); //<------------ UNEXPECTED: THIS FAILS b_defaulted.template fun(); //<------------ THIS IS FINE b_explicited.fun(); //<------------ UNEXPECTED: THIS FAILS b_explicited.template fun();//<------------ THIS IS FINE } int main(int argc, char const *argv[]) { tfun(); return 0; }