aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-12-08 15:00:37 -0500
committerJason Merrill <jason@gcc.gnu.org>2010-12-08 15:00:37 -0500
commitb8bf6ad91b81efc271a5c91c9db34af15e2a483c (patch)
tree5c4c91efbfc591c63836997af7094151c6fd8702 /gcc/cp/init.c
parentf4842525074ad8c1d7365ea5ea51a2d5b023293b (diff)
downloadgcc-b8bf6ad91b81efc271a5c91c9db34af15e2a483c.zip
gcc-b8bf6ad91b81efc271a5c91c9db34af15e2a483c.tar.gz
gcc-b8bf6ad91b81efc271a5c91c9db34af15e2a483c.tar.bz2
re PR c++/45822 (Qt 4.7.0 build fails)
PR c++/45822 * cp-tree.h (LOOKUP_DEFAULTED): New. * call.c (add_function_candidate): Check it. * method.c (synthesized_method_walk): Set it. (do_build_copy_assign): Likewise. * init.c (perform_member_init): Likewise. (emit_mem_initializers): Likewise. From-SVN: r167602
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 9de8c9f6..5a4f91c 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -503,6 +503,9 @@ perform_member_init (tree member, tree init)
}
else
{
+ int flags = LOOKUP_NORMAL;
+ if (DECL_DEFAULTED_FN (current_function_decl))
+ flags |= LOOKUP_DEFAULTED;
if (CP_TYPE_CONST_P (type)
&& init == NULL_TREE
&& !type_has_user_provided_default_constructor (type))
@@ -511,7 +514,7 @@ perform_member_init (tree member, tree init)
permerror (DECL_SOURCE_LOCATION (current_function_decl),
"uninitialized member %qD with %<const%> type %qT",
member, type);
- finish_expr_stmt (build_aggr_init (decl, init, 0,
+ finish_expr_stmt (build_aggr_init (decl, init, flags,
tf_warning_or_error));
}
}
@@ -852,11 +855,16 @@ sort_mem_initializers (tree t, tree mem_inits)
void
emit_mem_initializers (tree mem_inits)
{
+ int flags = LOOKUP_NORMAL;
+
/* We will already have issued an error message about the fact that
the type is incomplete. */
if (!COMPLETE_TYPE_P (current_class_type))
return;
+ if (DECL_DEFAULTED_FN (current_function_decl))
+ flags |= LOOKUP_DEFAULTED;
+
/* Sort the mem-initializers into the order in which the
initializations should be performed. */
mem_inits = sort_mem_initializers (current_class_type, mem_inits);
@@ -908,7 +916,7 @@ emit_mem_initializers (tree mem_inits)
cp_build_indirect_ref (base_addr, RO_NULL,
tf_warning_or_error),
arguments,
- LOOKUP_NORMAL,
+ flags,
tf_warning_or_error);
expand_cleanup_for_base (subobject, NULL_TREE);
}