1// PR c++/22621 2 3struct foo { 4 typedef int (*fun)(int); 5 6 static int f(int); // overload between static & non-static 7 int f(); 8 9 static int g(int); // non-overloaded static 10}; 11 12template<foo::fun> 13struct f_obj { 14 // something .. 15}; 16 17f_obj<&foo::f> a; // OK 18f_obj<foo::f> b; // OK (note: a and b are of the same type) 19 20int foo::f() 21{ 22 f_obj<&foo::f> a; // OK 23 f_obj<foo::f> b; // ERROR: foo::f cannot be a constant expression 24 25 f_obj<&foo::g> c; // OK 26 f_obj<foo::g> d; // OK 27} 28 29