[Bug c++/91070] New: Spurious notes about uninitialized members in C++17

bugs at qult dot net gcc-bugzilla@gcc.gnu.org
Wed Jul 3 10:42:00 GMT 2019


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

            Bug ID: 91070
           Summary: Spurious notes about uninitialized members in C++17
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugs at qult dot net
  Target Milestone: ---

I what appears to be the minimal example below,

struct foo { int a; };
int main()
{
  [](auto) {
    if (int x = []{ return 0; }()) {
      foo a;
      (void) a;
    }
  }(0);
  return 0;
}

GCC (-std=gnu++17) spits out the following:

<source>: In instantiation of ‘main()::<lambda(auto:1)> [with auto:1 = int]’:
<source>:9:6:   required from here
<source>:1:8: note: ‘struct foo’ has no user-provided default constructor
 struct foo { int a; };
        ^~~
<source>:1:18: note: and the implicitly-defined constructor does not initialize
‘int foo::a’
 struct foo { int a; };
                  ^
This looks like orphaned notes as in bug #90243.


More information about the Gcc-bugs mailing list