public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-498] [Ada] Freeze target type on qualified expression expansion Date: Mon, 16 May 2022 08:44:53 +0000 (GMT) [thread overview] Message-ID: <20220516084453.E99B53858C50@sourceware.org> (raw) 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);
reply other threads:[~2022-05-16 8:44 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220516084453.E99B53858C50@sourceware.org \ --to=pmderodat@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).