sem_util.adb (Defining_Entity): in case of error...
authorEd Schonberg <schonber@gnat.com>
Fri, 26 Oct 2001 01:26:05 +0000 (01:26 +0000)
committerGeert Bosch <bosch@gcc.gnu.org>
Fri, 26 Oct 2001 01:26:05 +0000 (03:26 +0200)
* sem_util.adb (Defining_Entity): in case of error, attach created
        entity to specification, so that semantic analysis can proceed.

From-SVN: r46515

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

index 2088cec2f39fe39a645f8e58deb8671511dec2f2..ecb970a0e8b943007291acb84c9535c7c899b658 100644 (file)
@@ -1,3 +1,8 @@
+2001-10-25  Ed Schonberg <schonber@gnat.com>
+
+       * sem_util.adb (Defining_Entity): in case of error, attach created 
+        entity to specification, so that semantic analysis can proceed.
+
 2001-10-25  Robert Dewar <dewar@gnat.com>
 
        * sem_util.adb 
index 658bef61fe021a522416522dc48c58949f9b47d1..7bc2b9230c0d3bd161291427b4b595b751260d41 100644 (file)
@@ -1103,7 +1103,8 @@ package body Sem_Util is
    ---------------------
 
    function Defining_Entity (N : Node_Id) return Entity_Id is
-      K : constant Node_Kind := Nkind (N);
+      K   : constant Node_Kind := Nkind (N);
+      Err : Entity_Id := Empty;
 
    begin
       case K is
@@ -1178,13 +1179,16 @@ package body Sem_Util is
                if Nkind (Nam) in N_Entity then
                   return Nam;
 
-               --  For Error, make up a name so we can continue
+               --  For Error, make up a name and attach to declaration
+               --  so we can continue semantic analysis
 
                elsif Nam = Error then
-                  return
+                  Err :=
                     Make_Defining_Identifier (Sloc (N),
                       Chars => New_Internal_Name ('T'));
+                  Set_Defining_Unit_Name (N, Err);
 
+                  return Err;
                --  If not an entity, get defining identifier
 
                else