]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Ensure a limited type is marking the packing as used
authorViljar Indus <indus@adacore.com>
Thu, 16 Jan 2025 19:40:54 +0000 (21:40 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 21 Nov 2025 08:29:36 +0000 (09:29 +0100)
gcc/ada/ChangeLog:

* sem_ch4.adb (Analyze_Call): ensure we generate a reference to the
non limited view of the return type to avoid scenarios where
the with-ed unit is not considered referenced.

gcc/ada/sem_ch4.adb

index c16e0453ec14c6034b13ffd34f658000159b962b..a735637d0e3d05cc20b32cf0d36a56aa84f34e05 100644 (file)
@@ -1626,6 +1626,7 @@ package body Sem_Ch4 is
                   or else Is_Thunk (Current_Scope))
             then
                Set_Etype (N, Non_Limited_View (Etype (N)));
+               Generate_Reference (Scope (Etype (N)), N);
 
             --  If there is no completion for the type, this may be because
             --  there is only a limited view of it and there is nothing in