public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Giuliano Belinassi <giulianob@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/autopar_devel] [Ada] Fix a couple of oversights in previous change
Date: Sat, 22 Aug 2020 22:00:14 +0000 (GMT)	[thread overview]
Message-ID: <20200822220014.B8E05393C837@sourceware.org> (raw)

https://gcc.gnu.org/g:4c1cebd6ccf3efd9816c1ad56a6b78ba9fc0dfdb

commit 4c1cebd6ccf3efd9816c1ad56a6b78ba9fc0dfdb
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Jan 28 23:52:17 2020 +0100

    [Ada] Fix a couple of oversights in previous change
    
    2020-06-04  Eric Botcazou  <ebotcazou@adacore.com>
    
    gcc/ada/
    
            * exp_ch7.adb (Make_Final_Call): Add missing guard.
            * sem_ch3.adb (Copy_And_Build): Adjust recursive call for
            private types.
            (Build_Derived_Private_Type): Deal with underlying full views.

Diff:
---
 gcc/ada/exp_ch7.adb |  1 +
 gcc/ada/sem_ch3.adb | 20 ++++++++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 9d7ed1229b0..fbdef9be497 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -8290,6 +8290,7 @@ package body Exp_Ch7 is
          Ref  := Convert_Concurrent (Ref, Typ);
 
       elsif Is_Private_Type (Typ)
+        and then Present (Underlying_Type (Typ))
         and then Is_Concurrent_Type (Underlying_Type (Typ))
       then
          Utyp := Corresponding_Record_Type (Underlying_Type (Typ));
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 8d86bc7d4cb..56e0aa26b53 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -7735,9 +7735,13 @@ package body Sem_Ch3 is
                end if;
 
             else
+               --  If the parent type is private, this is not a completion and
+               --  we build the full derivation recursively as a completion.
+
                Build_Derived_Type
                  (Full_N, Full_Parent, Full_Der,
-                  Is_Completion => False, Derive_Subps => False);
+                  Is_Completion => Is_Private_Type (Full_Parent),
+                  Derive_Subps => False);
             end if;
 
             --  The full declaration has been introduced into the tree and
@@ -7925,7 +7929,9 @@ package body Sem_Ch3 is
          --  case (see point 5. of its head comment) since we build it for the
          --  derived subtype.
 
-         if Present (Full_View (Parent_Type))
+         if (Present (Full_View (Parent_Type))
+             or else (Present (Underlying_Full_View (Parent_Type))
+                       and then Is_Completion))
            and then not Is_Itype (Derived_Type)
          then
             declare
@@ -7977,8 +7983,14 @@ package body Sem_Ch3 is
             end;
          end if;
 
-      elsif Present (Full_View (Parent_Type))
-        and then Has_Discriminants (Full_View (Parent_Type))
+      elsif (Present (Full_View (Parent_Type))
+              and then
+             Has_Discriminants (Full_View (Parent_Type)))
+        or else (Present (Underlying_Full_View (Parent_Type))
+                  and then
+                 Has_Discriminants (Underlying_Full_View (Parent_Type))
+                  and then
+                 Is_Completion)
       then
          if Has_Unknown_Discriminants (Parent_Type)
            and then Nkind (Subtype_Indication (Type_Definition (N))) =


                 reply	other threads:[~2020-08-22 22:00 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=20200822220014.B8E05393C837@sourceware.org \
    --to=giulianob@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).