diff options
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r-- | gcc/ada/sem_ch6.adb | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index d0c1f9e..946f217 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -321,7 +321,8 @@ package body Sem_Ch6 is -- check whether any of them is completed by the expression function. -- In a generic context a formal subprogram has no completion. - if Present (Prev) and then Is_Overloadable (Prev) + if Present (Prev) + and then Is_Overloadable (Prev) and then not Is_Formal_Subprogram (Prev) then Def_Id := Analyze_Subprogram_Specification (Spec); @@ -380,7 +381,8 @@ package body Sem_Ch6 is -- scope. The entity itself may be internally created if within a body -- to be inlined. - elsif Present (Prev) and then Comes_From_Source (Parent (Prev)) + elsif Present (Prev) + and then Comes_From_Source (Parent (Prev)) and then not Is_Formal_Subprogram (Prev) then Set_Has_Completion (Prev, False); @@ -2043,7 +2045,7 @@ package body Sem_Ch6 is elsif Ekind (Typ) = E_Incomplete_Type or else (Is_Class_Wide_Type (Typ) - and then Ekind (Root_Type (Typ)) = E_Incomplete_Type) + and then Ekind (Root_Type (Typ)) = E_Incomplete_Type) then -- AI05-0151: Tagged incomplete types are allowed in all formal -- parts. Untagged incomplete types are not allowed in bodies. @@ -2556,13 +2558,13 @@ package body Sem_Ch6 is -- a null access (see Expand_Interface_Conversion) and then not (Is_Interface (Designated_Type (Etype (Scop))) - and then not Comes_From_Source (Parent (Scop))) + and then not Comes_From_Source (Parent (Scop))) and then (Has_Task (Designated_Type (Etype (Scop))) or else - (Is_Class_Wide_Type (Designated_Type (Etype (Scop))) - and then - Is_Limited_Record (Designated_Type (Etype (Scop))))) + (Is_Class_Wide_Type (Designated_Type (Etype (Scop))) + and then + Is_Limited_Record (Designated_Type (Etype (Scop))))) and then Expander_Active -- Avoid cases with no tasking support @@ -2633,9 +2635,8 @@ package body Sem_Ch6 is Nkind (N) = N_Pragma and then (Pragma_Name (N) = Name_Inline_Always - or else - (Front_End_Inlining - and then Pragma_Name (N) = Name_Inline)) + or else (Front_End_Inlining + and then Pragma_Name (N) = Name_Inline)) and then Chars (Expression (First (Pragma_Argument_Associations (N)))) = @@ -2822,8 +2823,9 @@ package body Sem_Ch6 is if To_Corresponding then if Is_Concurrent_Type (Formal_Typ) and then Present (Corresponding_Record_Type (Formal_Typ)) - and then Present (Interfaces ( - Corresponding_Record_Type (Formal_Typ))) + and then + Present (Interfaces + (Corresponding_Record_Type (Formal_Typ))) then Set_Etype (Formal, Corresponding_Record_Type (Formal_Typ)); @@ -3018,7 +3020,7 @@ package body Sem_Ch6 is begin if Must_Override (Body_Spec) then if Nkind (Spec_Id) = N_Defining_Operator_Symbol - and then Operator_Matches_Spec (Spec_Id, Spec_Id) + and then Operator_Matches_Spec (Spec_Id, Spec_Id) then null; @@ -3044,7 +3046,7 @@ package body Sem_Ch6 is Body_Spec, Spec_Id); elsif Nkind (Spec_Id) = N_Defining_Operator_Symbol - and then Operator_Matches_Spec (Spec_Id, Spec_Id) + and then Operator_Matches_Spec (Spec_Id, Spec_Id) then Error_Msg_NE ("subprogram& overrides predefined operator ", @@ -3407,7 +3409,7 @@ package body Sem_Ch6 is and then not Comes_From_Source (N) and then (Nkind (Original_Node (Spec_Decl)) = - N_Subprogram_Renaming_Declaration + N_Subprogram_Renaming_Declaration or else (Present (Corresponding_Body (Spec_Decl)) and then Nkind (Unit_Declaration_Node @@ -4962,19 +4964,19 @@ package body Sem_Ch6 is -- F_Ptr. We catch this case in the code below. and then (Ekind (Old_Formal_Base) = Ekind (New_Formal_Base) - or else - (Is_Generic_Type (Old_Formal_Base) - and then Is_Generic_Type (New_Formal_Base) - and then Is_Internal (New_Formal_Base) - and then Etype (Etype (New_Formal_Base)) = - Old_Formal_Base)) - and then Directly_Designated_Type (Old_Formal_Base) = - Directly_Designated_Type (New_Formal_Base) + or else + (Is_Generic_Type (Old_Formal_Base) + and then Is_Generic_Type (New_Formal_Base) + and then Is_Internal (New_Formal_Base) + and then Etype (Etype (New_Formal_Base)) = + Old_Formal_Base)) + and then Directly_Designated_Type (Old_Formal_Base) = + Directly_Designated_Type (New_Formal_Base) and then ((Is_Itype (Old_Formal_Base) and then Can_Never_Be_Null (Old_Formal_Base)) - or else - (Is_Itype (New_Formal_Base) - and then Can_Never_Be_Null (New_Formal_Base))); + or else + (Is_Itype (New_Formal_Base) + and then Can_Never_Be_Null (New_Formal_Base))); -- Types must always match. In the visible part of an instance, -- usual overloading rules for dispatching operations apply, and |