[Bug c++/47347] "pragma GCC diagnostic ignored" has no effect sometimes

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 18 18:14:00 GMT 2011


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



More information about the Gcc-bugs mailing list