From: Viljar Indus <[email protected]>

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.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_ch4.adb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index c16e0453ec1..a735637d0e3 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -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
-- 
2.51.0

Reply via email to