diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-02-05 17:22:17 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-05 08:17:51 -0400 |
commit | 0ad46f04488199557f2b407f8d10839ef5c6e604 (patch) | |
tree | 62f477ec4fa4ce461119194b59f51b426ff330a2 /gcc | |
parent | f8ca4dd657f767c5f7da335462a5150ced368697 (diff) | |
download | gcc-0ad46f04488199557f2b407f8d10839ef5c6e604.zip gcc-0ad46f04488199557f2b407f8d10839ef5c6e604.tar.gz gcc-0ad46f04488199557f2b407f8d10839ef5c6e604.tar.bz2 |
[Ada] Do not create an empty list of nodes that confuses GNATprove
2020-06-05 Piotr Trojanek <trojanek@adacore.com>
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_aggr.adb | 11 |
1 files changed, 6 insertions, 5 deletions
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 |