public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1442] [Ada] Adjust previous change to Rewrite_As_Renaming
@ 2022-07-04 7:51 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-07-04 7:51 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:0896e2b79a3f7864b08f221a157a5c7fe8958116
commit r13-1442-g0896e2b79a3f7864b08f221a157a5c7fe8958116
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Sun May 29 13:35:57 2022 +0200
[Ada] Adjust previous change to Rewrite_As_Renaming
gcc/ada/
* exp_ch3.adb (Expand_N_Object_Declaration.Rewrite_As_Renaming):
Do not rewrite if the declaration has got constraints.
* sinfo.ads (Case Expression Alternative): Fix typo.
Diff:
---
gcc/ada/exp_ch3.adb | 19 +++++++++++++------
gcc/ada/sinfo.ads | 2 +-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 75d94b0947a..9759c8d0512 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -6865,13 +6865,20 @@ package body Exp_Ch3 is
and then
OK_To_Rename_Entity_Name (Prefix (Expr_Q)))));
begin
- -- ??? Return False if there are any aspect specifications, because
- -- otherwise we duplicate that corresponding implicit attribute
- -- definition, and call Insert_Action, which has no place to insert
- -- the attribute definition. The attribute definition is stored in
- -- Aspect_Rep_Item, which is not a list.
+ return Result
- return Result and then No (Aspect_Specifications (N));
+ -- The declaration cannot be rewritten if it has got constraints,
+ -- in other words the nominal subtype must be unconstrained.
+
+ and then Is_Entity_Name (Original_Node (Obj_Def))
+
+ -- ??? Return False if there are any aspect specifications, because
+ -- otherwise we duplicate that corresponding implicit attribute
+ -- definition, and call Insert_Action, which has no place to insert
+ -- the attribute definition. The attribute definition is stored in
+ -- Aspect_Rep_Item, which is not a list.
+
+ and then No (Aspect_Specifications (N));
end Rewrite_As_Renaming;
-- Local variables
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index e18a427f9a2..57c6438130b 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -4651,7 +4651,7 @@ package Sinfo is
-- Note: The Actions field temporarily holds any actions associated with
-- evaluation of the Expression. During expansion of the case expression
- -- these actions are wrapped into an N_Expressions_With_Actions node
+ -- these actions are wrapped into an N_Expression_With_Actions node
-- replacing the original expression.
-- Note: this node never appears in the tree passed to the back end,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-04 7:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 7:51 [gcc r13-1442] [Ada] Adjust previous change to Rewrite_As_Renaming 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).