diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-11 09:05:08 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-11 09:05:08 +0200 |
commit | b0887a432e679835dba79c5d6825f110bdf8a138 (patch) | |
tree | d5ecd111565223f691ba48e2126707ce03dd10f7 /gcc/ada/sem_aux.adb | |
parent | e0ae93e2ea3775ff2a3256c651ca9b285e2538cc (diff) | |
download | gcc-b0887a432e679835dba79c5d6825f110bdf8a138.zip gcc-b0887a432e679835dba79c5d6825f110bdf8a138.tar.gz gcc-b0887a432e679835dba79c5d6825f110bdf8a138.tar.bz2 |
[multiple changes]
2010-10-11 Javier Miranda <miranda@adacore.com>
* a-textio.adb: Move new implementation of Get_Line to a subunit.
* a-tigeli.adb: New subunit containing the implementation of Get_Line.
2010-10-11 Ed Schonberg <schonberg@adacore.com>
* sem_aux.adb: Code clean up.
From-SVN: r165272
Diffstat (limited to 'gcc/ada/sem_aux.adb')
-rwxr-xr-x | gcc/ada/sem_aux.adb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb index b670d43..7bda710 100755 --- a/gcc/ada/sem_aux.adb +++ b/gcc/ada/sem_aux.adb @@ -578,7 +578,10 @@ package body Sem_Aux is Btype : constant Entity_Id := Base_Type (Ent); begin - if Ekind (Btype) = E_Limited_Private_Type + if Is_Limited_Record (Btype) then + return True; + + elsif Ekind (Btype) = E_Limited_Private_Type and then Nkind (Parent (Btype)) = N_Formal_Type_Declaration then return not In_Package_Body (Scope ((Btype))); @@ -595,8 +598,11 @@ package body Sem_Aux is if not Is_Limited_Type (Etype (Btype)) then return False; + -- A descendant of a limited formal type is not immutably limited + -- in the generic body, or in the body of a generic child. + elsif Ekind (Scope (Etype (Btype))) = E_Generic_Package then - return not In_Package_Body (Scope (Etype (Btype))); + return not In_Package_Body (Scope (Btype)); else return False; @@ -626,10 +632,7 @@ package body Sem_Aux is -- handled as build in place even though they might return objects -- of a type that is not inherently limited. - if Is_Limited_Record (Btype) then - return True; - - elsif Is_Class_Wide_Type (Btype) then + if Is_Class_Wide_Type (Btype) then return Is_Immutably_Limited_Type (Root_Type (Btype)); else |