diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2023-02-24 00:47:47 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-23 09:59:07 +0200 |
commit | e77a66ee9a6049c7a6b0d351772ad61be775c447 (patch) | |
tree | d33f505055170baa005557af60bb6b8c8443ddca /gcc | |
parent | 47a084d96bb880d9c33b6be04aad883f1da2ad62 (diff) | |
download | gcc-e77a66ee9a6049c7a6b0d351772ad61be775c447.zip gcc-e77a66ee9a6049c7a6b0d351772ad61be775c447.tar.gz gcc-e77a66ee9a6049c7a6b0d351772ad61be775c447.tar.bz2 |
ada: Add tags to warnings controlled by Warn_On_Redundant_Constructs
Some of the calls to Error_Msg_N controlled by the flag
Warn_On_Redundant_Constructs missed the "?r?" tag in their message
string. This caused a misleading "[enabled by default]" label to appear
next to the error message.
Spotted while adding a warning about duplicated choices in exception
handlers.
gcc/ada/
* freeze.adb (Freeze_Record_Type): Add tag for redundant pragma Pack.
* sem_aggr.adb (Resolve_Record_Aggregate): Add tag for redundant OTHERS
choice.
* sem_ch8.adb (Use_One_Type): Add tag for redundant USE clauses.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/freeze.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem_aggr.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_ch8.adb | 10 |
3 files changed, 8 insertions, 8 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 990bace..6014f71 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -5500,7 +5500,7 @@ package body Freeze is if Warn_On_Redundant_Constructs then Error_Msg_N -- CODEFIX - ("??pragma Pack has no effect, no unplaced components", + ("?r?pragma Pack has no effect, no unplaced components", Get_Rep_Pragma (Rec, Name_Pack)); end if; end if; diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index b44708a..f1511b7 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -5834,9 +5834,9 @@ package body Sem_Aggr is ("OTHERS must represent at least one component", Selectr); elsif Others_Box = 1 and then Warn_On_Redundant_Constructs then - Error_Msg_N ("OTHERS choice is redundant?", Box_Node); + Error_Msg_N ("OTHERS choice is redundant?r?", Box_Node); Error_Msg_N - ("\previous choices cover all components?", Box_Node); + ("\previous choices cover all components?r?", Box_Node); end if; exit Verification; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 876dbac..212c13e 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -10755,7 +10755,7 @@ package body Sem_Ch8 is Error_Msg_Sloc := Sloc (Clause1); Error_Msg_NE -- CODEFIX ("& is already use-visible through previous " - & "use_type_clause #??", Clause2, T); + & "use_type_clause #?r?", Clause2, T); return; end if; @@ -10827,7 +10827,7 @@ package body Sem_Ch8 is Error_Msg_NE -- CODEFIX ("& is already use-visible through previous " - & "use_type_clause #??", Err_No, Id); + & "use_type_clause #?r?", Err_No, Id); end if; end Use_Clause_Known; @@ -10837,7 +10837,7 @@ package body Sem_Ch8 is else Error_Msg_NE -- CODEFIX ("& is already use-visible through previous " - & "use_type_clause??", Id, T); + & "use_type_clause?r?", Id, T); end if; -- The package where T is declared is already used @@ -10852,7 +10852,7 @@ package body Sem_Ch8 is Error_Msg_Sloc := Sloc (Find_First_Use (Current_Use_Clause (Scope (T)))); Error_Msg_NE -- CODEFIX - ("& is already use-visible through package use clause #??", + ("& is already use-visible through package use clause #?r?", Id, T); end if; @@ -10861,7 +10861,7 @@ package body Sem_Ch8 is else Error_Msg_Node_2 := Scope (T); Error_Msg_NE -- CODEFIX - ("& is already use-visible inside package &??", Id, T); + ("& is already use-visible inside package &?r?", Id, T); end if; end if; end Use_One_Type; |