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-1678] [Ada] Also deal with private actual types in latest change
Date: Wed, 13 Jul 2022 10:04:38 +0000 (GMT)	[thread overview]
Message-ID: <20220713100438.A41E438245BF@sourceware.org> (raw)

https://gcc.gnu.org/g:258814a99e74fcc1ab9cccb16b4d14c997d83690

commit r13-1678-g258814a99e74fcc1ab9cccb16b4d14c997d83690
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Fri Jun 24 19:28:53 2022 +0200

    [Ada] Also deal with private actual types in latest change
    
    gcc/ada/
    
            * gcc-interface/decl.cc (Gigi_Cloned_Subtype): Handle private case.

Diff:
---
 gcc/ada/gcc-interface/decl.cc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 8449c991e2b..53c84613e6a 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -5171,6 +5171,19 @@ Gigi_Cloned_Subtype (Entity_Id gnat_entity)
 	  && Present (Generic_Parent_Type (gnat_decl))
 	  && Is_Entity_Name (Subtype_Indication (gnat_decl)))
 	return Entity (Subtype_Indication (gnat_decl));
+
+      /* Likewise for the full view of such subtypes when they are private.  */
+      if (Is_Itype (gnat_entity))
+	{
+	  gnat_decl = Associated_Node_For_Itype (gnat_entity);
+	  if (Present (gnat_decl)
+	      && Nkind (gnat_decl) == N_Subtype_Declaration
+	      && Is_Private_Type (Defining_Identifier (gnat_decl))
+	      && Full_View (Defining_Identifier (gnat_decl)) == gnat_entity
+	      && Present (Generic_Parent_Type (gnat_decl))
+	      && Is_Entity_Name (Subtype_Indication (gnat_decl)))
+	    return Entity (Subtype_Indication (gnat_decl));
+	}
       break;
 
     default:


                 reply	other threads:[~2022-07-13 10:04 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=20220713100438.A41E438245BF@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: 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).