public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-498] [Ada] Freeze target type on qualified expression expansion
@ 2022-05-16 8:44 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-16 8:44 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:26bbf0e5da9af096eeddc2a79e1e0da9673b6bd2
commit r13-498-g26bbf0e5da9af096eeddc2a79e1e0da9673b6bd2
Author: Etienne Servais <servais@adacore.com>
Date: Mon Mar 14 14:35:43 2022 +0100
[Ada] Freeze target type on qualified expression expansion
An object declaration (other than a deferred constant declaration)
causes freezing where it occurs (13.14(6)), which means every name
occurring within it causes freezing (13.14(4/1)), and when the name in a
subtype_mark causes freezing, the denoted subtype is frozen (13.14(11)).
Hence, one needs to freeze the target type when expanding a qualified
expression.
gcc/ada/
* exp_ch4.adb (Expand_N_Qualified_Expression): Freeze
Target_Type.
Diff:
---
gcc/ada/exp_ch4.adb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 99fac5f8b6b..74d40e5affd 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -10776,6 +10776,8 @@ package body Exp_Ch4 is
Ensure_Valid (Operand);
end if;
+ Freeze_Before (Operand, Target_Type);
+
-- Apply possible constraint check
Apply_Constraint_Check (Operand, Target_Type, No_Sliding => True);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-16 8:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16 8:44 [gcc r13-498] [Ada] Freeze target type on qualified expression expansion 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).