https://gcc.gnu.org/g:67d149f3a75ce30c62a02409b4c5675b860b6bd4

commit r17-956-g67d149f3a75ce30c62a02409b4c5675b860b6bd4
Author: Bob Duff <[email protected]>
Date:   Tue Mar 24 18:43:16 2026 -0400

    ada: Do not disable conformance warning in GNAT_Mode
    
    The switch -gnatw_p enables a warning during conformance
    checking that is stricter than the standard Ada conformance
    rules. This patch removes the test for -gnatg mode when
    issuing the warning, because that is redundant -- -gnatg
    already turns off -gnatw_p.
    
    We do not want this warning enabled in GNAT sources, but there is
    no need to have -gnatg involved explicitly.
    The same goes for In_Internal_Unit.
    
    gcc/ada/ChangeLog:
    
            * sem_ch6.adb (Subprogram_Subtypes_Have_Same_Declaration):
            Remove tests for In_Internal_Unit and GNAT_Mode.

Diff:
---
 gcc/ada/sem_ch6.adb | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 67d92626c16d..dd794a708962 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -5637,9 +5637,8 @@ package body Sem_Ch6 is
       --  Checks whether corresponding subtypes named within a subprogram
       --  declaration and body originate from the same declaration, and returns
       --  True when they do. In the case of anonymous access-to-object types,
-      --  checks the designated types. Also returns True when GNAT_Mode is
-      --  enabled, or when the subprogram is marked Is_Internal or occurs
-      --  within a generic instantiation or internal unit (GNAT library unit).
+      --  checks the designated subtypes. Also returns True when the subprogram
+      --  is marked Is_Internal or occurs within a generic instantiation.
 
       -----------------------
       -- Conformance_Error --
@@ -5819,9 +5818,7 @@ package body Sem_Ch6 is
 
       begin
          if not In_Instance
-           and then not In_Internal_Unit (Subp)
            and then not Is_Internal (Subp)
-           and then not GNAT_Mode
            and then
              Ekind (Etype (Decl_Subtype)) not in Access_Subprogram_Kind
          then

Reply via email to