diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-31 11:37:54 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-31 11:37:54 +0200 |
commit | 702d2020441d58a06cd7b161483d9c099e56c72b (patch) | |
tree | 87048b5ff4d217dd7e8fcd9e17b9a880972dc532 /gcc/ada/sem_ch6.adb | |
parent | 67645bdee6a5c57b2ce51bbafbb69cf510ebf189 (diff) | |
download | gcc-702d2020441d58a06cd7b161483d9c099e56c72b.zip gcc-702d2020441d58a06cd7b161483d9c099e56c72b.tar.gz gcc-702d2020441d58a06cd7b161483d9c099e56c72b.tar.bz2 |
[multiple changes]
2011-08-31 Jose Ruiz <ruiz@adacore.com>
* s-taprop-vxworks.adb, s-taprop-mingw.adb, s-taprop-linux.adb,
s-taprop-solaris.adb (Create_Task): Not_A_Specific_CPU can be assigned
to any dispatching domain.
2011-08-31 Thomas Quinot <quinot@adacore.com>
* exp_ch4.adb: Minor reformatting.
2011-08-31 Bob Duff <duff@adacore.com>
* sem_ch6.adb (Get_Generic_Parent_Type): Don't query Subtype_Indication
on nodes for which it is not defined.
(Is_Non_Overriding_Operation): Exit the loop when we find a generic
parent type.
2011-08-31 Bob Duff <duff@adacore.com>
* sem_ch3.adb (Process_Full_View): Disable legality check if
In_Instance, to avoid spurious errors.
* sem_ch12.adb (Validate_Derived_Type_Instance): Disable legality check
if In_Instance, to avoid spurious errors.
2011-08-31 Pascal Obry <obry@adacore.com>
* a-direct.adb: Use Dir_Seps everywhere to properly handle all
directory speparators.
(Compose): Use Dir_Seps to handle both forms.
(Create_Path): Use Dir_Seps instead of explicit check, no semantic
changes.
(Extension): Use Dir_Seps to handle both forms.
2011-08-31 Pascal Obry <obry@adacore.com>
* prj-conf.adb: Minor reformatting.
From-SVN: r178372
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r-- | gcc/ada/sem_ch6.adb | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 290b53d..242cfcb 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -7214,6 +7214,7 @@ package body Sem_Ch6 is function Get_Generic_Parent_Type (F_Typ : Entity_Id) return Entity_Id is G_Typ : Entity_Id; + Defn : Node_Id; Indic : Node_Id; begin @@ -7226,19 +7227,21 @@ package body Sem_Ch6 is -- is needed for cases where a full derived type has been -- rewritten.) - Indic := Subtype_Indication - (Type_Definition (Original_Node (Parent (F_Typ)))); + Defn := Type_Definition (Original_Node (Parent (F_Typ))); + if Nkind (Defn) = N_Derived_Type_Definition then + Indic := Subtype_Indication (Defn); - if Nkind (Indic) = N_Subtype_Indication then - G_Typ := Entity (Subtype_Mark (Indic)); - else - G_Typ := Entity (Indic); - end if; + if Nkind (Indic) = N_Subtype_Indication then + G_Typ := Entity (Subtype_Mark (Indic)); + else + G_Typ := Entity (Indic); + end if; - if Nkind (Parent (G_Typ)) = N_Subtype_Declaration - and then Present (Generic_Parent_Type (Parent (G_Typ))) - then - return Generic_Parent_Type (Parent (G_Typ)); + if Nkind (Parent (G_Typ)) = N_Subtype_Declaration + and then Present (Generic_Parent_Type (Parent (G_Typ))) + then + return Generic_Parent_Type (Parent (G_Typ)); + end if; end if; end if; @@ -7295,9 +7298,10 @@ package body Sem_Ch6 is and then In_Private_Part (Current_Scope) and then Comes_From_Source (New_E) then - -- We examine the formals and result subtype of the inherited - -- operation, to determine whether their type is derived from (the - -- instance of) a generic type. + -- We examine the formals and result type of the inherited operation, + -- to determine whether their type is derived from (the instance of) + -- a generic type. The first such formal or result type is the one + -- tested. Formal := First_Formal (Prev_E); while Present (Formal) loop @@ -7308,6 +7312,7 @@ package body Sem_Ch6 is end if; G_Typ := Get_Generic_Parent_Type (F_Typ); + exit when Present (G_Typ); Next_Formal (Formal); end loop; |