http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47347
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-18 17:32:39 UTC --- reduced: #pragma GCC diagnostic ignored "-Wunused-parameter" template <class> struct KeyValue { virtual void serialize(int a) const { } }; void f() { KeyValue<int> values; } #pragma GCC diagnostic warning "-Wunused-parameter" The template instantiation is at the end of the file, after the warning has been re-enabled. There's no warning with 4.6.0