]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix incorrect incomplete type error
authorViljar Indus <indus@adacore.com>
Thu, 5 Dec 2024 09:47:05 +0000 (11:47 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 6 Jan 2025 09:14:45 +0000 (10:14 +0100)
In Ada 2005 even if the formal is using a tagged limited type
then the type should not be considered incomplete.

gcc/ada/ChangeLog:

* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
Exchange_Limited_Views also in Ada 2005.

gcc/ada/sem_ch6.adb

index 2f09284ebdadb981639e5b36f2a1f9fef02dd032..ab12f22ad51a26a91ecd5693ca3b1a47e6cef6ba 100644 (file)
@@ -4536,8 +4536,10 @@ package body Sem_Ch6 is
       --  may now appear in parameter and result profiles. Since the analysis
       --  of a subprogram body may use the parameter and result profile of the
       --  spec, swap any limited views with their non-limited counterpart.
+      --
+      --  Note that the non-limited view should also be exchanged in Ada 2005.
 
-      if Ada_Version >= Ada_2012 and then Present (Spec_Id) then
+      if Ada_Version >= Ada_2005 and then Present (Spec_Id) then
          Exch_Views := Exchange_Limited_Views (Spec_Id);
       end if;