sem_util.adb (Enter_Name): better handling of cascaded error messages when a unit appears in its own context.

* sem_util.adb (Enter_Name): better handling of cascaded error
        messages when a unit appears in its own context.

From-SVN: r46516
This commit is contained in:
Ed Schonberg 2001-10-26 01:29:47 +00:00 committed by Geert Bosch
parent 5a15af6295
commit dfc69d80c1
2 changed files with 17 additions and 0 deletions

View 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

View 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);