diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-29 13:00:08 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-29 13:00:08 +0000 |
commit | 99ed4b4ce96bec3446145e7c97dd173e7e8edd82 (patch) | |
tree | 3e0836e2432482756fcd199eecdab0169bd974f4 /gcc/ada/exp_ch3.adb | |
parent | cda40848caccff3268bd45e8e5ef6211c1fb92ac (diff) | |
download | gcc-99ed4b4ce96bec3446145e7c97dd173e7e8edd82.tar.gz |
2014-07-29 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Document pragma Unevaluated_Use_Of_Old.
* opt.adb: Handle Uneval_Old.
* opt.ads (Uneval_Old, Uneval_Old_Config): New variables.
* par-prag.adb: Add dummy entry for pragma Unevaluated_Use_Of_Old.
* sem.ads (Save_Uneval_Old): New field in Scope_Stack_Entry.
* sem_attr.adb (Uneval_Old_Msg): New procedure.
* sem_ch8.adb (Push_Scope): Save Uneval_Old.
(Pop_Scope): Restore Uneval_Old.
* sem_prag.adb (Analyze_Pragma, case Unevaluated_Use_Of_Old):
Implemented.
* snames.ads-tmpl: Add entries for pragma Unevaluated_Use_Of_Old
Add entries for Name_Warn, Name_Allow.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213160 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch3.adb')
-rw-r--r-- | gcc/ada/exp_ch3.adb | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 38327e904e4..bd5aef94245 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -6160,12 +6160,15 @@ package body Exp_Ch3 is -- If the component contains tasks, so does the array type. This may -- not be indicated in the array type because the component may have -- been a private type at the point of definition. Same if component - -- type is controlled. + -- type is controlled or contains protected objects. - Set_Has_Task (Base, Has_Task (Comp_Typ)); - Set_Has_Controlled_Component (Base, - Has_Controlled_Component (Comp_Typ) - or else Is_Controlled (Comp_Typ)); + Set_Has_Task (Base, Has_Task (Comp_Typ)); + Set_Has_Protected (Base, Has_Protected (Comp_Typ)); + Set_Has_Controlled_Component + (Base, Has_Controlled_Component + (Comp_Typ) + or else + Is_Controlled (Comp_Typ)); if No (Init_Proc (Base)) then @@ -6719,9 +6722,9 @@ package body Exp_Ch3 is Check_Stream_Attributes (Def_Id); end if; - -- Update task and controlled component flags, because some of the - -- component types may have been private at the point of the record - -- declaration. Detect anonymous access-to-controlled components. + -- Update task, protected, and controlled component flags, because some + -- of the component types may have been private at the point of the + -- record declaration. Detect anonymous access-to-controlled components. Has_AACC := False; @@ -6731,20 +6734,26 @@ package body Exp_Ch3 is if Has_Task (Comp_Typ) then Set_Has_Task (Def_Id); + end if; + + if Has_Protected (Comp_Typ) then + Set_Has_Protected (Def_Id); + end if; -- Do not set Has_Controlled_Component on a class-wide equivalent -- type. See Make_CW_Equivalent_Type. - elsif not Is_Class_Wide_Equivalent_Type (Def_Id) + if not Is_Class_Wide_Equivalent_Type (Def_Id) and then (Has_Controlled_Component (Comp_Typ) or else (Chars (Comp) /= Name_uParent and then Is_Controlled (Comp_Typ))) then Set_Has_Controlled_Component (Def_Id); + end if; -- Non-self-referential anonymous access-to-controlled component - elsif Ekind (Comp_Typ) = E_Anonymous_Access_Type + if Ekind (Comp_Typ) = E_Anonymous_Access_Type and then Needs_Finalization (Designated_Type (Comp_Typ)) and then Designated_Type (Comp_Typ) /= Def_Id then |