https://gcc.gnu.org/g:950df6096f8a5e01ec56471fcfc95ad44f5494e3

commit r15-6570-g950df6096f8a5e01ec56471fcfc95ad44f5494e3
Author: Viljar Indus <in...@adacore.com>
Date:   Thu Dec 5 11:47:05 2024 +0200

    ada: Fix incorrect incomplete type error
    
    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.

Diff:
---
 gcc/ada/sem_ch6.adb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 2f09284ebdad..ab12f22ad51a 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -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;

Reply via email to