https://gcc.gnu.org/g:b1bce7a5a805cc303b4fe475baaed1dcab3030a1

commit r17-930-gb1bce7a5a805cc303b4fe475baaed1dcab3030a1
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 3d84a57490b4..bd919e2bac7f 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