public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-521] [Ada] Check token to be "access", reject it if not
Date: Tue, 17 May 2022 08:27:27 +0000 (GMT)	[thread overview]
Message-ID: <20220517082727.59638385781D@sourceware.org> (raw)

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;


                 reply	other threads:[~2022-05-17  8:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220517082727.59638385781D@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).