]> gcc.gnu.org Git - gcc.git/commitdiff
sem_util.adb (Enter_Name): better handling of cascaded error messages when a unit...
authorEd Schonberg <schonber@gnat.com>
Fri, 26 Oct 2001 01:29:47 +0000 (01:29 +0000)
committerGeert Bosch <bosch@gcc.gnu.org>
Fri, 26 Oct 2001 01:29:47 +0000 (03:29 +0200)
* sem_util.adb (Enter_Name): better handling of cascaded error
        messages when a unit appears in its own context.

From-SVN: r46516

gcc/ada/ChangeLog
gcc/ada/sem_util.adb

index ecb970a0e8b943007291acb84c9535c7c899b658..2a96c895dd69840b7dc8ba2984fb63a1a1f9d4ab 100644 (file)
@@ -1,3 +1,8 @@
+2001-10-25  Ed Schonberg <schonber@gnat.com>
+
+       * sem_util.adb (Enter_Name): better handling of cascaded error 
+        messages when a unit appears in its own context.
+
 2001-10-25  Ed Schonberg <schonber@gnat.com>
 
        * sem_util.adb (Defining_Entity): in case of error, attach created 
index 7bc2b9230c0d3bd161291427b4b595b751260d41..e53f8718de249ff42b2fd8a0efddd3025f349d83 100644 (file)
@@ -1602,6 +1602,18 @@ package body Sem_Util is
                Error_Msg_N ("& conflicts with declaration#", E);
                return;
 
+            --  If the name of the unit appears in its own context clause,
+            --  a dummy package with the name has already been created, and
+            --  the error emitted. Try to continue quietly.
+
+            elsif Error_Posted (E)
+              and then Sloc (E) = No_Location
+              and then Nkind (Parent (E)) = N_Package_Specification
+              and then Current_Scope = Standard_Standard
+            then
+               Set_Scope (Def_Id, Current_Scope);
+               return;
+
             else
                Error_Msg_N ("& conflicts with declaration#", Def_Id);
 
This page took 0.074703 seconds and 5 git commands to generate.