From: Viljar Indus Date: Thu, 5 Dec 2024 09:47:05 +0000 (+0200) Subject: ada: Fix incorrect incomplete type error X-Git-Tag: basepoints/gcc-16~2983 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=950df6096f8a5e01ec56471fcfc95ad44f5494e3;p=thirdparty%2Fgcc.git 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 --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;