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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |sjames at gcc dot gnu.org
   Target Milestone|---                         |12.0

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
We diagnose this from GCC 12 onwards.

$ gcc-15 -Og -g -Wall -Wextra -c test.cpp
test.cpp: In constructor ‘B::B(int)’:
test.cpp:5:11: warning: member ‘B::b’ is used uninitialized [-Wuninitialized]
    5 |         a(b), b(100)
      |           ^
test.cpp: In constructor ‘B::B(int)’:
test.cpp:5:9: warning: ‘*this.B::b’ is used uninitialized [-Wuninitialized]
    5 |         a(b), b(100)
      |         ^~~~

The output got better in 13+.

Reply via email to