* [Ada] Adjust previous change to Expand_Subtype_From_Expr
@ 2022-09-02 7:53 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2022-09-02 7:53 UTC (permalink / raw)
To: gcc-patches; +Cc: Eric Botcazou
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
An aggregate may have been rewritten before being seen by the procedure.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_util.adb (Expand_Subtype_From_Expr): Be prepared for
rewritten aggregates as expressions.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 584 bytes --]
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -5741,7 +5741,7 @@ package body Exp_Util is
-- non-statically-matching subtypes on 'Access of this object.
and then (Nkind (N) /= N_Object_Declaration
- or else Nkind (Exp) = N_Aggregate
+ or else Nkind (Original_Node (Exp)) = N_Aggregate
or else Is_Constr_Subt_For_U_Nominal (Exp_Typ))
then
-- Within an initialization procedure, a selected component
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-02 7:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02 7:53 [Ada] Adjust previous change to Expand_Subtype_From_Expr 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).