OSDN Git Service

2008-08-06 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Aug 2008 08:32:42 +0000 (08:32 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Aug 2008 08:32:42 +0000 (08:32 +0000)
* sem_ch3.adb (Find_Type_Name): protect against duplicate incomplete
declaration for the same type.

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

gcc/ada/sem_ch3.adb

index 8f02795..ffc1be8 100644 (file)
@@ -13210,6 +13210,13 @@ package body Sem_Ch3 is
             Set_Scope (Id, Current_Scope);
             New_Id := Id;
 
+            --  If this is a repeated incomplete declaration, no further
+            --  checks are possible.
+
+            if Nkind (N) = N_Incomplete_Type_Declaration then
+               return Prev;
+            end if;
+
          --  Case of full declaration of incomplete type
 
          elsif Ekind (Prev) = E_Incomplete_Type then