This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/2972] -Wuninitialized could warn about uninitialized member variable usage in constructors
- From: "jwakely dot gcc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jun 2010 11:24:42 -0000
- Subject: [Bug c++/2972] -Wuninitialized could warn about uninitialized member variable usage in constructors
- References: <bug-2972-381@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from jwakely dot gcc at gmail dot com 2010-06-03 11:24 -------
Created an attachment (id=20817)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20817&action=view)
better -Wmeminit patch
This version ignores empty classes and checks for a nontrivial default ctor
instead of layout_pod_type.
This patch doesn't enable the warning unless explicity requested. I realise
that this warning is about enforcing style ("members should be initialised in
the mem-initializer-list not in the ctor body") but that's ok because it's my
preferred style, I just don't want the compiler to enforce other people's
preferred style ;)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2972