summaryrefslogtreecommitdiffstats
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-06 16:24:10 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-06 16:24:10 +0000
commit17d06bda5972da8a4b83108a04a7439feba7efb2 (patch)
tree08c627bf433274036f7dd2e38ab7337efe321c10 /gcc/cp/init.c
parent4fd7a6de975754293afb33387470b88e24831254 (diff)
downloadppe42-gcc-17d06bda5972da8a4b83108a04a7439feba7efb2.tar.gz
ppe42-gcc-17d06bda5972da8a4b83108a04a7439feba7efb2.zip
PR c++/54341
PR c++/54253 * semantics.c (sort_constexpr_mem_initializers): New. (build_constexpr_constructor_member_initializers): Use it. (cx_check_missing_mem_inits): Skip artificial fields. * init.c (expand_aggr_init_1): Don't zero out a class with no data. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191033 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 09288f87e20..561477ace57 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1742,8 +1742,10 @@ expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags,
that's value-initialization. */
if (init == void_type_node)
{
- /* If no user-provided ctor, we need to zero out the object. */
- if (!type_has_user_provided_constructor (type))
+ /* If the type has data but no user-provided ctor, we need to zero
+ out the object. */
+ if (!type_has_user_provided_constructor (type)
+ && !is_really_empty_class (type))
{
tree field_size = NULL_TREE;
if (exp != true_exp && CLASSTYPE_AS_BASE (type) != type)
OpenPOWER on IntegriCloud