[Bug c++/81674] gcc cannot detect missing initialisers for fields in constructors

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 20 23:18:00 GMT 2018


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |manu at gcc dot gnu.org

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
The patch here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19808#c29
once finished should be able to catch this, because it walks the
mem-initializer list and marks whatever is initialized. At the end of the list,
it could just warn about whatever was not initialized.

There will be false positives because it will not look at the body of the
constructor but this is something that could be improved later and, in any
case, it will never be fixed because it is as hard as -Wuninitialized.


More information about the Gcc-bugs mailing list