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-4959] ada: Cannot reference ghost entity in class-wide precondition Date: Tue, 3 Jan 2023 09:33:38 +0000 (GMT) [thread overview] Message-ID: <20230103093338.86A11385840C@sourceware.org> (raw) https://gcc.gnu.org/g:930b81af5b0207585819ea9988a0f50d009940a7 commit r13-4959-g930b81af5b0207585819ea9988a0f50d009940a7 Author: Javier Miranda <miranda@adacore.com> Date: Mon Nov 28 09:15:54 2022 +0000 ada: Cannot reference ghost entity in class-wide precondition gcc/ada/ * ghost.adb (Is_OK_Declaration): A reference to a Ghost entity may appear within the class-wide precondition of a helper subprogram. This context is treated as suitable because it was already verified when we were analyzing the original class-wide precondition. Diff: --- gcc/ada/ghost.adb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb index 0f03285b024..0d2a23dc042 100644 --- a/gcc/ada/ghost.adb +++ b/gcc/ada/ghost.adb @@ -261,6 +261,16 @@ package body Ghost is then return True; + -- A reference to a Ghost entity may appear within the class-wide + -- precondition of a helper subprogram. This context is treated + -- as suitable because it was already verified when we were + -- analyzing the original class-wide precondition. + + elsif Is_Subprogram (Current_Scope) + and then Present (Class_Preconditions_Subprogram (Current_Scope)) + then + return True; + -- References to Ghost entities may be relocated in internally -- generated bodies.
reply other threads:[~2023-01-03 9:33 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=20230103093338.86A11385840C@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).