From: Justin Squirek Date: Thu, 7 May 2020 11:26:59 +0000 (-0400) Subject: [Ada] Hang on generic declaration with ambiguous formal package X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce16f54f6edf9c440046f6dd454e1dcbbb1ffae3;p=gcc.git [Ada] Hang on generic declaration with ambiguous formal package gcc/ada/ * sem_ch12.adb (Analyze_Associations): Add check for errors on the generic formal before continuing with instantiation. --- diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index ff8a15a016d..9865de4802e 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -1948,10 +1948,19 @@ package body Sem_Ch12 is end if; when N_Formal_Package_Declaration => - Match := - Matching_Actual - (Defining_Identifier (Formal), - Defining_Identifier (Original_Node (Analyzed_Formal))); + -- The name of the formal package may be hidden by the + -- formal parameter itself. + + if Error_Posted (Analyzed_Formal) then + Abandon_Instantiation (Instantiation_Node); + + else + Match := + Matching_Actual + (Defining_Identifier (Formal), + Defining_Identifier + (Original_Node (Analyzed_Formal))); + end if; if No (Match) then if Partial_Parameterization then