* init.c (perform_member_init): check for uninitialized const or
reference members, including array types.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158817
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-04-27 Fabien ChĂȘne <fabien.chene@gmail.com>
+
+ PR c++/29043
+ * init.c (perform_member_init): check for uninitialized const or
+ reference members, including array types.
+
2010-04-24 Jason Merrill <jason@redhat.com>
* tree.c (get_fns): Split out from get_first_fn.
2010-04-24 Jason Merrill <jason@redhat.com>
* tree.c (get_fns): Split out from get_first_fn.
{
if (init == NULL_TREE)
{
{
if (init == NULL_TREE)
{
/* member traversal: note it leaves init NULL */
if (TREE_CODE (type) == REFERENCE_TYPE)
permerror (DECL_SOURCE_LOCATION (current_function_decl),
/* member traversal: note it leaves init NULL */
if (TREE_CODE (type) == REFERENCE_TYPE)
permerror (DECL_SOURCE_LOCATION (current_function_decl),
permerror (DECL_SOURCE_LOCATION (current_function_decl),
"uninitialized member %qD with %<const%> type %qT",
member, type);
permerror (DECL_SOURCE_LOCATION (current_function_decl),
"uninitialized member %qD with %<const%> type %qT",
member, type);
+
+ core_type = strip_array_types (type);
+ if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (core_type)
+ || CLASSTYPE_REF_FIELDS_NEED_INIT (core_type))
+ diagnose_uninitialized_cst_or_ref_member (core_type, /*using_new=*/false);
}
else if (TREE_CODE (init) == TREE_LIST)
/* There was an explicit member initialization. Do some work
}
else if (TREE_CODE (init) == TREE_LIST)
/* There was an explicit member initialization. Do some work
+2010-04-27 Fabien ChĂȘne <fabien.chene@gmail.com>
+
+ PR c++/29043
+ * g++.dg/init/pr29043.C: New.
+
2010-04-27 Jason Merrill <jason@redhat.com>
* g++.dg/lookup/scoped5.C: Adjust.
2010-04-27 Jason Merrill <jason@redhat.com>
* g++.dg/lookup/scoped5.C: Adjust.