* sem_util.adb (Defining_Entity): in case of error, attach created
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Oct 2001 01:26:05 +0000 (01:26 +0000)
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Oct 2001 01:26:05 +0000 (01:26 +0000)
        entity to specification, so that semantic analysis can proceed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46515 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 2088cec..ecb970a 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 658bef6..7bc2b92 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