public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Don't check for misspelling of Not_A_Restriction_Id
@ 2022-07-12 12:25 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-07-12 12:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: Piotr Trojanek

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

When looking for a misspelling of a restriction identifier we should
ignore the Not_A_Restriction_Id literal, because it doesn't represent
any restriction.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
	Fix range of iteration.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 426 bytes --]

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -10561,7 +10561,7 @@ package body Sem_Prag is
 
                   --  Check for possible misspelling
 
-                  for J in Restriction_Id loop
+                  for J in All_Restrictions loop
                      declare
                         Rnm : constant String := Restriction_Id'Image (J);
 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-12 12:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 12:25 [Ada] Don't check for misspelling of Not_A_Restriction_Id Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).