diff options
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 25134b6dc7c..542ffee3f51 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2868,8 +2868,8 @@ package body Sem_Ch3 is -- 2. Those generated by the Expression - -- 3. Those used to constrained the Object Definition with the - -- expression constraints when it is unconstrained + -- 3. Those used to constrain the Object Definition with the + -- expression constraints when the definition is unconstrained -- They must be generated in this order to avoid order of elaboration -- issues. Thus the first step (after entering the name) is to analyze @@ -17399,9 +17399,13 @@ package body Sem_Ch3 is and then (Is_Limited_Type (Full_T) or else Is_Limited_Composite (Full_T)) then - Error_Msg_N - ("completion of nonlimited type cannot be limited", Full_T); - Explain_Limited_Type (Full_T, Full_T); + if In_Instance then + null; + else + Error_Msg_N + ("completion of nonlimited type cannot be limited", Full_T); + Explain_Limited_Type (Full_T, Full_T); + end if; elsif Is_Abstract_Type (Full_T) and then not Is_Abstract_Type (Priv_T) |