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 r14-1327] ada: Fix retrieval of spec entity from entry body entity
Date: Mon, 29 May 2023 08:28:59 +0000 (GMT)	[thread overview]
Message-ID: <20230529082859.4AF8E3856DE2@sourceware.org> (raw)

https://gcc.gnu.org/g:a17e01a6ce3956d79454047bfe4a3a405e89be7f

commit r14-1327-ga17e01a6ce3956d79454047bfe4a3a405e89be7f
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Wed Mar 29 16:21:01 2023 +0200

    ada: Fix retrieval of spec entity from entry body entity
    
    When retrieving entities of subprogram spec we only handled functions
    and procedures, but not entries. This had no consequences, because we
    then only applied checks to functions, but still is worth a cleanup, so
    the code is easier to adapt for access-to-subprogram entities as well.
    
    gcc/ada/
    
            * sem_util.adb (Check_Result_And_Post_State): Properly handle entry
            bodies.

Diff:
---
 gcc/ada/sem_util.adb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 1839214332d..d71329bbcb2 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -4582,6 +4582,9 @@ package body Sem_Util is
       then
          Spec_Id := Corresponding_Spec_Of_Stub (Subp_Decl);
 
+      elsif Nkind (Subp_Decl) = N_Entry_Body then
+         Spec_Id := Corresponding_Spec (Subp_Decl);
+
       else
          Spec_Id := Subp_Id;
       end if;

                 reply	other threads:[~2023-05-29  8:28 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=20230529082859.4AF8E3856DE2@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: link
Be 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).