diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-03 15:10:58 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-03 15:10:58 +0000 |
commit | aab874cec78e1099844472ad81ffed8bc86ffa16 (patch) | |
tree | 38a7f7a6df807eb6be54895eaac6ba1d026d395a /gcc/ada/freeze.adb | |
parent | 4ff973937cb2f91188c989737015f799eb81ba01 (diff) | |
download | gcc-aab874cec78e1099844472ad81ffed8bc86ffa16.tar.gz |
* exp_util.adb (Make_CW_Equivalent_Type): Set the
Is_Class_Wide_Equivalent_Type flag here in lieu of...
(Make_Subtype_From_Expr): ...here.
* exp_ch3.adb (Expand_Freeze_Record_Type): Do not set
Has_Controlled_Component on class-wide equivalent types.
* freeze.adb (Freeze_Record_Type): Likewise.
* sem_ch3.adb (Record_Type_Definition): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154950 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/freeze.adb')
-rw-r--r-- | gcc/ada/freeze.adb | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 7f0f7863824..26b821d38d1 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -2185,14 +2185,21 @@ package body Freeze is Comp := First_Component (Rec); while Present (Comp) loop - if Has_Controlled_Component (Etype (Comp)) - or else (Chars (Comp) /= Name_uParent - and then Is_Controlled (Etype (Comp))) - or else (Is_Protected_Type (Etype (Comp)) - and then Present - (Corresponding_Record_Type (Etype (Comp))) - and then Has_Controlled_Component - (Corresponding_Record_Type (Etype (Comp)))) + + -- Do not set Has_Controlled_Component on a class-wide + -- equivalent type. See Make_CW_Equivalent_Type. + + if not Is_Class_Wide_Equivalent_Type (Rec) + and then (Has_Controlled_Component (Etype (Comp)) + or else (Chars (Comp) /= Name_uParent + and then Is_Controlled (Etype (Comp))) + or else (Is_Protected_Type (Etype (Comp)) + and then Present + (Corresponding_Record_Type + (Etype (Comp))) + and then Has_Controlled_Component + (Corresponding_Record_Type + (Etype (Comp))))) then Set_Has_Controlled_Component (Rec); exit; |