From: Eric Botcazou Date: Fri, 21 Apr 2023 16:30:48 +0000 (+0200) Subject: ada: Fix wrong expansion of limited extension aggregate X-Git-Tag: basepoints/gcc-15~8380 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=ae3fd5e8a75bf7cf18a98b0d0545ade976c1ec05;p=gcc.git ada: Fix wrong expansion of limited extension aggregate This happens when the ancestor part is itself an aggregate: in this case, the tag of the extension aggregate is wrongly set to that of the ancestor. gcc/ada/ * exp_aggr.adb (Build_Record_Aggr_Code): In the case of an extension aggregate of a limited type whose ancestor part is an aggregate, do not skip the final code assigning the tag of the extension. --- diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index c145d79f4829..152305711239 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -3039,8 +3039,6 @@ package body Exp_Aggr is and then Nkind (Unqualify (Ancestor)) in N_Aggregate | N_Extension_Aggregate then - Ancestor_Is_Expression := True; - -- Set up finalization data for enclosing record, because -- controlled subcomponents of the ancestor part will be -- attached to it.