[Ada] Relax null exclusion mismatch check in Relaxed_RM_Semantics mode
authorArnaud Charlet <charlet@adacore.com>
Mon, 15 Mar 2021 07:45:35 +0000 (03:45 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 18 Jun 2021 08:36:46 +0000 (04:36 -0400)
gcc/ada/

* sem_ch6.adb (Null_Exclusions_Match): Relax null exclusion
mismatch check when Relaxed_RM_Semantics is set.

gcc/ada/sem_ch6.adb

index 7bca9df..d46d3f3 100644 (file)
@@ -6265,7 +6265,9 @@ package body Sem_Ch6 is
 
             --  Null exclusion must match
 
-            if not Null_Exclusions_Match (Old_Formal, New_Formal) then
+            if not Relaxed_RM_Semantics
+              and then not Null_Exclusions_Match (Old_Formal, New_Formal)
+            then
                Conformance_Error
                  ("\null exclusion for& does not match", New_Formal);