template < void ( *F )() > struct X { }; template < typename T > struct Y { static void f() { } typedef X< f > F; }; Y< void > test;
$ g++ 0.cpp -c 0.cpp: In instantiation of ‘Y<void>’: 0.cpp:9: instantiated from here 0.cpp:7: error: ‘static void Y<T>::f() [with T = void]’ cannot appear in a constant-expression -- Summary: static functionclass member Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pluto at agmk dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35570