https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63707

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
At least for #c5 the important difference between that testcase and // ~Child
();
which is accepted is I think since
r0-113052-ge2df21bfc6c81b4bc410a42002c8427454ffa628
in the cp/init.c (perform_member_init) code:
888           /* A FIELD_DECL doesn't really have a suitable lifetime, but
889              make_temporary_var_for_ref_to_temp will treat it as automatic
and
890              set_up_extended_ref_temp wants to use the decl in a warning. 
*/
891           init = extend_ref_init_temps (member, init, &cleanups);
892           if (TREE_CODE (type) == ARRAY_TYPE
893               && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (type)))
894             init = build_vec_init_expr (type, init, tf_warning_or_error);
If it has trivial destructor, nothing calls build_vec_init_expr and the copy
ctor isn't needed, but when it is called, it is needed.
I think in this case extend_ref_init_temps doesn't do anything at all, so it is
unclear if build_vec_init_expr is needed too or not.

Reply via email to