This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81674] gcc cannot detect missing initialisers for fields in constructors
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 06 Feb 2018 15:29:43 +0000
- Subject: [Bug c++/81674] gcc cannot detect missing initialisers for fields in constructors
- Auto-submitted: auto-generated
- References: <bug-81674-4@http.gcc.gnu.org/bugzilla/>
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++]
$