public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-coroutines] [Ada] Hang on generic declaration with ambiguous formal package
@ 2020-07-06 20:59 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2020-07-06 20:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ce16f54f6edf9c440046f6dd454e1dcbbb1ffae3

commit ce16f54f6edf9c440046f6dd454e1dcbbb1ffae3
Author: Justin Squirek <squirek@adacore.com>
Date:   Thu May 7 07:26:59 2020 -0400

    [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:
---
 gcc/ada/sem_ch12.adb | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-06 20:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 20:59 [gcc/devel/c++-coroutines] [Ada] Hang on generic declaration with ambiguous formal package Iain D Sandoe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).