public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6470] [Ada] Accept square brackets for expression functions
@ 2022-01-11 13:28 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-01-11 13:28 UTC (permalink / raw)
To: gcc-cvs
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-11 13:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 13:28 [gcc r12-6470] [Ada] Accept square brackets for expression functions 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).