https://gcc.gnu.org/g:52be9c63f8f05e648117e7bdb28beee27566a12a

commit r16-9015-g52be9c63f8f05e648117e7bdb28beee27566a12a
Author: Piotr Trojanek <[email protected]>
Date:   Wed Mar 11 22:00:46 2026 +0100

    ada: Suppress warning about unused quantified variables with junk names
    
    For quantified expressions like "for all Dummy in ... => True" we don't want
    to warn about unused variable when it has a junk name.
    
    gcc/ada/ChangeLog:
    
            * sem_ch4.adb (Analyze_Quantified_Expression): Suppress warning for
            variables with junk names.

Diff:
---
 gcc/ada/sem_ch4.adb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 2018035baeef..6aecf1ae21d8 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -4815,6 +4815,7 @@ package body Sem_Ch4 is
       begin
          if Warn_On_Suspicious_Contract
            and then not Is_Internal_Name (Chars (Loop_Id))
+           and then not Has_Junk_Name (Loop_Id)
          then
             if not Referenced (Loop_Id, Cond) then
                Error_Msg_N ("?.t?unused variable &", Loop_Id);

Reply via email to