g++-4.4 gives odd error about <anonymous> being uninitialized around a vector resize(). // test case: tc_uninit.cc #include <vector> struct A { double time; size_t id; A() { } // uninitialized }; struct B { typedef std::vector<A> array_type; array_type array; void foo(void); }; void B::foo(void) { array.resize(1); } % g++-4 -pipe -ansi -pedantic-errors -Wold-style-cast -Woverloaded-virtual -W -Wextra -Wall -Wundef -Wshadow -Wno-unused-parameter -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Werror -std=c++0x -Wno-error=conversion -g -O3 -Wno-long-long -c tc_uninit.cc -o tc_uninit.o cc1plus: warnings being treated as errors tc_uninit.cc: In member function 'void B::foo()': tc_uninit.cc:21: error: '<anonymous>' is used uninitialized in this function {standard input}:unknown:Undefined local symbol L__Znwm$stub {standard input}:unknown:Undefined local symbol L__ZdlPv$stub {standard input}:unknown:Undefined local symbol L__ZSt20__throw_length_errorPKc$stub Observations: while trying to reduce, when either member of A is removed, the diagnostic ceases and successfully compiles. Aside, is there a good way to suppress those unhelpful stdin diagnostics? build/host: powerpc-apple-darwin8
Should probably compare with set of reports blocking PR 24639...
Works on the trunk.
The best we can do is to add this testcase to GCC 4.5 and close this as FIXED in mainline. These kind of fixes are typically not easy to backport.
Per comments #2 and #3.