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 r12-6470] [Ada] Accept square brackets for expression functions Date: Tue, 11 Jan 2022 13:28:36 +0000 (GMT) [thread overview] Message-ID: <20220111132836.77CAE38A941F@sourceware.org> (raw) https://gcc.gnu.org/g:805655c137088519751e4ca18df722355a512d88 commit r12-6470-g805655c137088519751e4ca18df722355a512d88 Author: Etienne Servais <servais@adacore.com> Date: Mon Jan 3 14:41:58 2022 +0100 [Ada] Accept square brackets for expression functions gcc/ada/ * par-ch6.adb (Scan_Body_Or_Expression_Function): Accept left bracket as token to open an expression function. Diff: --- gcc/ada/par-ch6.adb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb index 1b3cf94af5c..d972eadbda5 100644 --- a/gcc/ada/par-ch6.adb +++ b/gcc/ada/par-ch6.adb @@ -841,7 +841,14 @@ package body Ch6 is begin -- Expression_Function case - if Token = Tok_Left_Paren + -- If likely an aggregate, check we are in Ada 2022 mode + + if Token = Tok_Left_Bracket then + Error_Msg_Ada_2022_Feature + ("!aggregates as expression function", Token_Ptr); + end if; + + if Token in Tok_Left_Paren | Tok_Left_Bracket or else Likely_Expression_Function then -- Check expression function allowed here
reply other threads:[~2022-01-11 13:28 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=20220111132836.77CAE38A941F@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: linkBe 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).