diff options
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index babcc70eda6..c84006d4668 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -987,6 +987,7 @@ package body Sem_Ch12 is Defining_Identifier (Analyzed_Formal)); if No (Match) then + Error_Msg_Sloc := Sloc (Gen_Unit); Error_Msg_NE ("missing actual&", Instantiation_Node, Defining_Identifier (Formal)); @@ -1075,6 +1076,7 @@ package body Sem_Ch12 is Defining_Identifier (Original_Node (Analyzed_Formal))); if No (Match) then + Error_Msg_Sloc := Sloc (Gen_Unit); Error_Msg_NE ("missing actual&", Instantiation_Node, Defining_Identifier (Formal)); @@ -1111,6 +1113,8 @@ package body Sem_Ch12 is end loop; if Num_Actuals > Num_Matched then + Error_Msg_Sloc := Sloc (Gen_Unit); + if Present (Selector_Name (Actual)) then Error_Msg_NE ("unmatched actual&", @@ -2348,6 +2352,8 @@ package body Sem_Ch12 is elsif Ekind (Gen_Unit) /= E_Generic_Package then + -- Ada0Y (AI-50217): Instance can not be used in limited with_clause + if From_With_Type (Gen_Unit) then Error_Msg_N ("cannot instantiate a limited withed package", Gen_Id); @@ -6620,6 +6626,7 @@ package body Sem_Ch12 is end if; else + Error_Msg_Sloc := Sloc (Scope (Analyzed_S)); Error_Msg_NE ("missing actual&", Instantiation_Node, Formal_Sub); Error_Msg_NE @@ -6746,6 +6753,9 @@ package body Sem_Ch12 is Subt_Decl : Node_Id := Empty; begin + -- Sloc for error message on missing actual. + Error_Msg_Sloc := Sloc (Scope (Defining_Identifier (Analyzed_Formal))); + if Get_Instance_Of (Formal_Id) /= Formal_Id then Error_Msg_N ("duplicate instantiation of generic parameter", Actual); end if; |