This one causes tons of warnings in the libstdc++ testsuite (with -Wall in CXXFLAGS) and seems also bogus to me.
struct ratio { static const int a = 3; }; const int ratio::a; int f() { ratio r; return r.a; } -- Summary: Another bogus set-but-not-used warning Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: paolo dot carlini at oracle dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44412