http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57072
Bug #: 57072 Summary: bogus "is used uninitialized" warning Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: ppluzhni...@google.com Google ref: b/8700048 Test: struct A { ~A() __attribute__((noreturn)); A& stream(); template <typename T> void operator<<(T&); }; struct C { enum State { S1, S2 }; static bool Fn(State s) { switch (s) { case S2: A().stream() << s; } } }; void TestFn() { for (int i = 0; i < 2; ++i) { C::Fn ? (void) 0 : A().stream() << " "; C::Fn(static_cast<C::State>(i)); } } Using g++ (GCC) 4.9.0 20130412 (experimental) (r197936): g++ -c -Wuninitialized -O2 -fno-tree-vrp t.cc t.cc: In function ‘void TestFn()’: t.cc:16:6: warning: ‘s’ is used uninitialized in this function [-Wuninitialized] void TestFn() ^ This warning doesn't trigger on 4_7-branch, but a slightly less reduced test case does, so it's likely not a recent regression.