in certain cases, GCC is unable to pass a static reference as a template parameter. SCENARIO 1 (SUCCEEDS): //test1.cpp template class X { public: static const T x; }; template class Y { public: typedef X wrapper_t; template class Foo { }; public: typedef Foo type; }; SCENARIO 2 (FAILS): // test2.cpp template class X { public: static const T x; }; template class Y { public: typedef X wrapper_t; template class Foo { }; public: typedef Foo type; }; template class Y; COMPILER ERROR FOR SCENARIO 2: test2.cpp:14: error: ‘X::x’ cannot appear in a constant-expression test2.cpp:14: error: template argument 1 is invalid -- Summary: static reference as a template parameter fails Product: gcc Version: 4.4.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: navinkumar+bugs at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41972