class X { public: static X& instance(); static void init(); private: X(); };
void f() { X& x = X::instance(); x.init(); } in this case the 'x' variable is initialized and unused. gcc-4.2 accepts this w/o any warning at -Wall -Wextra but vs2005-express reports warning C4189 at warning level 4. -- Summary: missed diagnostic about unused variable. Product: gcc Version: 4.2.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pluto at agmk dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33003