This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52541] g++ allows definition of const POD
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 09 Mar 2012 11:29:04 +0000
- Subject: [Bug c++/52541] g++ allows definition of const POD
- Auto-submitted: auto-generated
- References: <bug-52541-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52541
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-09 11:29:04 UTC ---
This behavior changed on purpose, see testcase: g++.dg/init/const8.C.
2011-09-23 Jason Merrill <jason@redhat.com>
Core 253 - allow const objects with no initializer or
user-provided default constructor if the defaulted constructor
initializes all the subobjects.
PR c++/20039
PR c++/42844
* class.c (default_init_uninitialized_part): New.
* cp-tree.h: Declare it.
* decl.c (check_for_uninitialized_const_var): Use it.
* init.c (perform_member_init): Likewise.
(build_new_1): Likewise.
* method.c (walk_field_subobs): Likewise.