From: Piotr Trojanek Date: Wed, 5 Feb 2020 16:22:17 +0000 (+0100) Subject: [Ada] Do not create an empty list of nodes that confuses GNATprove X-Git-Tag: upstream/12.2.0~15963 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ad46f04488199557f2b407f8d10839ef5c6e604;p=platform%2Fupstream%2Fgcc.git [Ada] Do not create an empty list of nodes that confuses GNATprove 2020-06-05 Piotr Trojanek gcc/ada/ * sem_aggr.adb (Resolve_Record_Aggregate): Create the N_Aggregate node with its Expressions field set to No_List and not to an empty list. --- diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 5e43417..88df535 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -147,9 +147,10 @@ package body Sem_Aggr is -- -- Once this new Component_Association_List is built and all the semantic -- checks performed, the original aggregate subtree is replaced with the - -- new named record aggregate just built. Note that subtree substitution is - -- performed with Rewrite so as to be able to retrieve the original - -- aggregate. + -- new named record aggregate just built. This new record aggregate has no + -- positional associations, so its Expressions field is set to No_List. + -- Note that subtree substitution is performed with Rewrite so as to be + -- able to retrieve the original aggregate. -- -- The aggregate subtree manipulation performed by Resolve_Record_Aggregate -- yields the aggregate format expected by Gigi. Typically, this kind of @@ -3990,7 +3991,7 @@ package body Sem_Aggr is begin if Is_Record_Type (T) and then Has_Discriminants (T) then - New_Aggr := Make_Aggregate (Loc, New_List, New_List); + New_Aggr := Make_Aggregate (Loc, No_List, New_List); Set_Etype (New_Aggr, T); Add_Association @@ -5043,7 +5044,7 @@ package body Sem_Aggr is Expr : Node_Id; begin - Expr := Make_Aggregate (Loc, New_List, New_List); + Expr := Make_Aggregate (Loc, No_List, New_List); Set_Etype (Expr, Ctyp); -- If the enclosing type has discriminants, they have