public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Marc Poulhi?s <dkm@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5019] ada: Further adjust freezing for expansion of contracts Date: Thu, 5 Jan 2023 14:38:40 +0000 (GMT) [thread overview] Message-ID: <20230105143840.A9556385840D@sourceware.org> (raw) https://gcc.gnu.org/g:59d1681bf3dec3a5077247a77e4862516b561284 commit r13-5019-g59d1681bf3dec3a5077247a77e4862516b561284 Author: Eric Botcazou <ebotcazou@adacore.com> Date: Fri Dec 16 16:32:15 2022 +0100 ada: Further adjust freezing for expansion of contracts This further adjusts a test deciding whether to freeze an entity coming from an outer scope in an inner scope based on language rules, to the presence of the new internal subprogram generated because of post-conditions. gcc/ada/ * freeze.adb (Freeze_Entity): For the purpose of deciding whether to freeze an entity coming from an outer scope in an inner scope, treat the internal subprogram generated because of post-conditions as also coming from source if the original subprogram itself does. Diff: --- gcc/ada/freeze.adb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 7f78b4315a8..97a25d10835 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -6281,7 +6281,10 @@ package body Freeze is end if; -- Otherwise, loop through scopes checking if an enclosing scope - -- comes from source or is a generic. + -- comes from source or is a generic. Note that, for the purpose + -- of this test, we need to consider that the internally generated + -- subprogram described above comes from source too if the original + -- subprogram itself does. declare S : Entity_Id; @@ -6291,6 +6294,8 @@ package body Freeze is while Present (S) loop if Is_Overloadable (S) then if Comes_From_Source (S) + or else (Chars (S) = Name_uWrapped_Statements + and then Comes_From_Source (Scope (S))) or else Is_Generic_Instance (S) or else Is_Child_Unit (S) then
reply other threads:[~2023-01-05 14:38 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=20230105143840.A9556385840D@sourceware.org \ --to=dkm@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).