public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-521] [Ada] Check token to be "access", reject it if not
@ 2022-05-17 8:27 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-17 8:27 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:7cff43618e6f300915ff9061608a974728315146
commit r13-521-g7cff43618e6f300915ff9061608a974728315146
Author: Etienne Servais <servais@adacore.com>
Date: Wed Mar 16 17:48:22 2022 +0100
[Ada] Check token to be "access", reject it if not
The parser skips the token without verifying it is indeed "access". So
any token is accepted.
gcc/ada/
* par-ch3.adb (P_Access_Type_Definition): Outputs an error if
token is not "access".
Diff:
---
gcc/ada/par-ch3.adb | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb
index 08ffd7bf826..d7d12554ffd 100644
--- a/gcc/ada/par-ch3.adb
+++ b/gcc/ada/par-ch3.adb
@@ -4205,7 +4205,15 @@ package body Ch3 is
-- second null exclusion is present in the access type definition.
Not_Null_Present := P_Null_Exclusion; -- Ada 2005 (AI-231)
+
+ if Token /= Tok_Access then
+ Error_Msg
+ ("ACCESS expected",
+ Token_Ptr);
+ end if;
+
Scan; -- past ACCESS
+
Not_Null_Subtype_Loc := Token_Ptr;
Not_Null_Subtype := P_Null_Exclusion; -- Might also appear
end if;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-17 8:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 8:27 [gcc r13-521] [Ada] Check token to be "access", reject it if not 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).