------- Comment #3 from pinskia at gcc dot gnu dot org 2009-08-20 20:49 ------- You cannot use a static variable in a template :). Note the following is valid though: namespace { int i; } template <typename> int f() { return i; }
And still invokes the warning: t4.cc:1:17: warning: '<unnamed>::i' defined but not used -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41134