aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2020-05-07 07:26:59 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-06 07:35:10 -0400
commitce16f54f6edf9c440046f6dd454e1dcbbb1ffae3 (patch)
tree874a06d0e62e4fa24690da29b66b5787d05cac38 /gcc
parent90d8163d9b9d90ceeead4e360b9d8d8dc2878074 (diff)
downloadgcc-ce16f54f6edf9c440046f6dd454e1dcbbb1ffae3.zip
gcc-ce16f54f6edf9c440046f6dd454e1dcbbb1ffae3.tar.gz
gcc-ce16f54f6edf9c440046f6dd454e1dcbbb1ffae3.tar.bz2
[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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch12.adb17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index ff8a15a..9865de4 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