https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106541

            Bug ID: 106541
           Summary: Missing -Wuninitialized on self initialization if
                    external code is called earlier in the function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: blubban at gmail dot com
  Target Milestone: ---

struct my_class {
        int data[4];
};

void fn1();

void fn2()
{
        my_class local = local;
}

void fn3()
{
        fn1();
        my_class local = local;
}


Compile with g++ -Wall.

Expected: Two warnings. Or maybe zero, if this is not considered a use.

Actual: Former complains, latter does not. That extra function call should not
affect the warning count.

https://godbolt.org/z/vhdnq1Ec1

Reply via email to