sem_ch3.adb (Find_Type_Name): protect against duplicate incomplete declaration for...
authorEd Schonberg <schonberg@adacore.com>
Wed, 6 Aug 2008 08:32:42 +0000 (10:32 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 6 Aug 2008 08:32:42 +0000 (10:32 +0200)
2008-08-06  Ed Schonberg  <schonberg@adacore.com>

* sem_ch3.adb (Find_Type_Name): protect against duplicate incomplete
declaration for the same type.

From-SVN: r138773

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