https://gcc.gnu.org/g:06f8d3229d296c43e94ca5b94ba93bd6b00f51ad

commit r17-5615-g06f8d3229d296c43e94ca5b94ba93bd6b00f51ad
Author: Ronan Desplanques <[email protected]>
Date:   Tue Oct 27 11:28:40 2026 +0100

    Ada: Fix constrained-vs-definite confusion
    
    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.
    
    gcc/ada/
            * sem_ch3.adb (Process_Full_View): Fix test.

Diff:
---
 gcc/ada/sem_ch3.adb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index f95cea479d66..8b1fb68391f7 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