This replaces a test for constrainedness by a more appropriate test for
definiteness in a legality check. The surrounding comments were already
correctly talking about definitenesss and already pointed to the right
Ada RM clause.

Tested on x86-64/Linux, applied on the mainline.


2026-10-27  Ronan Desplanques  <[email protected]>

        * sem_ch3.adb (Process_Full_View): Fix test.

-- 
Eric Botcazou
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index f95cea479d6..8b1fb68391f 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -22029,10 +22029,10 @@ package body Sem_Ch3 is
 
             elsif not Has_Unknown_Discriminants (Priv_T)
               and then not Has_Discriminants (Priv_T)
-              and then not Is_Constrained (Full_T)
+              and then not Is_Definite_Subtype (Full_T)
             then
                Error_Msg_N
-                 ("full view must define a constrained type if partial view "
+                 ("full view must define a definite type if partial view "
                   & "has no discriminants", Full_T);
             end if;
          end if;

Reply via email to