From 2a60c08e98acaae212840b2d3329b5bd13778581 Mon Sep 17 00:00:00 2001 From: Bob Duff Date: Fri, 10 Dec 2021 06:01:22 -0500 Subject: [Ada] Warn on subtype declaration of null range gcc/ada/ * sem_res.adb (Resolve_Range): Warn on null range, unless we are inside a generic unit or an instance thereof. * sem_ch3.adb (Analyze_Subtype_Indication): Minor: avoid double negative. --- gcc/ada/sem_ch3.adb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/ada/sem_ch3.adb') diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 7643cd1..ce5f453 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -6048,13 +6048,13 @@ package body Sem_Ch3 is begin Analyze (T); - if R /= Error then + if R = Error then + Set_Error_Posted (R); + Set_Error_Posted (T); + else Analyze (R); Set_Etype (N, Etype (R)); Resolve (R, Entity (T)); - else - Set_Error_Posted (R); - Set_Error_Posted (T); end if; end Analyze_Subtype_Indication; -- cgit v1.1