User account creation filtered due to spam.

Bug 39936

Summary: [4.4 only] -Wuninitialized false positive with unhelpful diagnostic
Product: gcc Reporter: David Fang <fang>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Severity: normal CC: gcc-bugs, law, manu
Priority: P3    
Version: 4.4.0   
Target Milestone: ---   
Host: Target:
Build: Known to work: 4.5.0
Known to fail: 4.4.0 Last reconfirmed: 2009-11-19 12:22:23
Bug Depends on:    
Bug Blocks: 24639    

Description David Fang 2009-04-28 02:23:53 UTC
g++-4.4 gives odd error about <anonymous> being uninitialized around a vector resize().

// test case:
#include <vector>

struct A {
        double                  time;
        size_t                  id;

        A() { }         // uninitialized


struct B {
        typedef std::vector<A>  array_type;
        array_type              array;


B::foo(void) {

% 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  -o tc_uninit.o

cc1plus: warnings being treated as errors In member function 'void B::foo()': 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
Comment 1 David Fang 2009-04-28 02:31:22 UTC
Should probably compare with set of reports blocking PR 24639...
Comment 2 Andrew Pinski 2009-04-28 22:19:20 UTC
Works on the trunk.
Comment 3 Manuel López-Ibáñez 2009-11-19 12:22:23 UTC
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.
Comment 4 Jeffrey A. Law 2013-11-20 00:58:08 UTC
Per comments #2 and #3.