// C++ PR 70317 // { dg-do compile } // { dg-prune-output "expected primary-expression" } template class mytemplateclass { public: template void class_func() {} template static void class_func_static() {} }; class myclass { public: int testint; template void class_func() {} template static void class_func_static() {} }; template void tests_func(mytemplateclass c, myclass c2) { /* Dependent template accessors (ill-formed code). */ c.class_func(); // { dg-warning "keyword before dependent template name" } (&c)->class_func(); // { dg-warning "keyword before dependent template name" } mytemplateclass::class_func_static(); // { dg-warning "keyword before dependent template name" } /* Dependent template accessors (well-formed code). */ c.template class_func(); (&c)->template class_func(); mytemplateclass::template class_func_static(); /* Non-dependent template accessors (well-formed code). */ c2.class_func(); (&c2)->class_func(); myclass::class_func_static(); } int main() { mytemplateclass c; myclass c2; tests_func(c, c2); c2.testint = 53; /* Make sure this isn't treated as a template. */ bool testbool = c2.testint < 999 > 7; /* This probably will be treated as a template initially but it should still work. */ testbool = c2.testint < 123 > (50); }