From 15918371923d3e31a9f74c46fbe94e7e1e6d76e6 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 10 Oct 2013 14:17:35 +0200 Subject: [multiple changes] 2013-10-10 Robert Dewar * lib-xref-spark_specific.adb, par-ch13.adb, sem_prag.adb, sem_prag.ads, sem_ch12.adb, sem_attr.adb, sem_ch6.adb, sem_ch13.adb, a-sequio.adb, s-atocou-builtin.adb: Minor reformatting. 2013-10-10 Thomas Quinot * s-oscons-tmplt.c (NEED_PTHREAD_CONDATTR_SETCLOCK): This constant needs to be output to s-oscons.h, as it is tested by init.c. 2013-10-10 Robert Dewar * exp_ch3.adb (Expand_N_Variant_Part): Don't expand choices, too early * exp_ch5.adb (Expand_N_Case_Statement): Use new Has_SP_Choice flag to avoid expanding choices when not necessary. * exp_util.adb: Minor reformatting * freeze.adb (Freeze_Record_Type): Redo expansion of variants * sem_aggr.adb: Minor reformatting * sem_case.ads, sem_case.adb: Major rewrite, separating Analysis and Checking of choices. * sem_ch3.adb (Analyze_Variant_Part): Rewrite to call new Analyze_Choices. * sem_ch4.adb (Analyze_Case_Expression): Call Analyze_Choices and Check_Choices * sem_ch5.adb (Analyze_Case_Statement): Call Analyze_Choices and Check_Choices * sem_util.adb: Minor reformatting * sinfo.ads, sinfo.adb (Has_SP_Choice): New flag. 2013-10-10 Vincent Celier * mlib-prj.adb (Build_Library): Do not issue link dynamic libraries with an Rpath, if switch -R was used. 2013-10-10 Tristan Gingold * s-stalib.ads (Image_Index_Table_8, Image_Index_Table_16, Image_Index_Table_32): Remove as not used. * s-imgint.adb (Image_Integer): Call Set_Image_Integer and remove duplicated code. From-SVN: r203358 --- gcc/ada/sem_aggr.adb | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'gcc/ada/sem_aggr.adb') diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 9d7d7b7..404242f 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -3416,6 +3416,7 @@ package body Sem_Aggr is begin -- A record aggregate is restricted in SPARK: + -- Each named association can have only a single choice. -- OTHERS cannot be used. -- Positional and named associations cannot be mixed. @@ -3758,6 +3759,8 @@ package body Sem_Aggr is end loop; end Find_Private_Ancestor; + -- Start of processing for Step_5 + begin if Is_Derived_Type (Typ) and then Is_Tagged_Type (Typ) then Parent_Typ_List := New_Elmt_List; @@ -3822,11 +3825,12 @@ package body Sem_Aggr is if Nkind (Dnode) = N_Full_Type_Declaration then Record_Def := Type_Definition (Dnode); - Gather_Components (Base_Type (Typ), - Component_List (Record_Def), - Governed_By => New_Assoc_List, - Into => Components, - Report_Errors => Errors_Found); + Gather_Components + (Base_Type (Typ), + Component_List (Record_Def), + Governed_By => New_Assoc_List, + Into => Components, + Report_Errors => Errors_Found); end if; end if; @@ -3915,19 +3919,20 @@ package body Sem_Aggr is null; elsif not Has_Unknown_Discriminants (Typ) then - Gather_Components (Base_Type (Typ), - Component_List (Record_Def), - Governed_By => New_Assoc_List, - Into => Components, - Report_Errors => Errors_Found); + Gather_Components + (Base_Type (Typ), + Component_List (Record_Def), + Governed_By => New_Assoc_List, + Into => Components, + Report_Errors => Errors_Found); else Gather_Components (Base_Type (Underlying_Record_View (Typ)), - Component_List (Record_Def), - Governed_By => New_Assoc_List, - Into => Components, - Report_Errors => Errors_Found); + Component_List (Record_Def), + Governed_By => New_Assoc_List, + Into => Components, + Report_Errors => Errors_Found); end if; end if; -- cgit v1.1