public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3730] ada: Reject boxes in delta array aggregates
@ 2022-11-07 8:39 Marc Poulhi?s
0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2022-11-07 8:39 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:2caaa4bf336bce2a7d649aa05f2851d576a26e5e
commit r13-3730-g2caaa4bf336bce2a7d649aa05f2851d576a26e5e
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Thu Oct 14 17:50:43 2021 +0200
ada: Reject boxes in delta array aggregates
Implement Ada 2022 4.3.4(11/5), which rejects box compound delimiter <>
in delta record aggregates, just like another rule rejects it in delta
array aggregates.
gcc/ada/
* sem_aggr.adb (Resolve_Delta_Array_Aggregate): Reject boxes in
delta array aggregates.
Diff:
---
gcc/ada/sem_aggr.adb | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 87a8c1a3c40..31ce9cadd94 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -3531,7 +3531,18 @@ package body Sem_Aggr is
Next (Choice);
end loop;
- Analyze_And_Resolve (Expression (Assoc), Component_Type (Typ));
+ -- For an array_delta_aggregate, the array_component_association
+ -- shall not use the box symbol <>; RM 4.3.4(11/5).
+
+ pragma Assert
+ (Box_Present (Assoc) xor Present (Expression (Assoc)));
+
+ if Box_Present (Assoc) then
+ Error_Msg_N
+ ("'<'> in array delta aggregate is not allowed", Assoc);
+ else
+ Analyze_And_Resolve (Expression (Assoc), Component_Type (Typ));
+ end if;
end if;
Next (Assoc);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-07 8:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07 8:39 [gcc r13-3730] ada: Reject boxes in delta array aggregates Marc Poulhi?s
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).