[Bug c++/81674] gcc cannot detect missing initialisers for fields in constructors
egallager at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 6 15:30:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81674
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
-Weffc++ catches it:
$ $ /usr/local/bin/g++ -c -O2 -Wall -Wextra -pedantic -Weffc++ 81674.cc
81674.cc: In constructor 'S::S()':
81674.cc:5:3: warning: 'S::b' should be initialized in the member
initialization list [-Weffc++]
S() : a( 0)
^
81674.cc:5:3: warning: 'S::c' should be initialized in the member
initialization list [-Weffc++]
$
More information about the Gcc-bugs
mailing list