public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2902] ada: Bugbox compiling Constrained_Protected_Object'Image
@ 2023-08-01  8:07 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-08-01  8:07 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:77604913b73e35b1b7f38725c526ac558ff165be

commit r14-2902-g77604913b73e35b1b7f38725c526ac558ff165be
Author: Steve Baird <baird@adacore.com>
Date:   Thu Jun 8 15:08:11 2023 -0700

    ada: Bugbox compiling Constrained_Protected_Object'Image
    
    In some cases, a bugbox is generated when compiling an example
    that references X'Image, where X is a constrained object of a
    discriminated protected type.
    
    gcc/ada/
    
            * sem_ch3.adb (Constrain_Corresponding_Record): When copying
            information from the unconstrained record type to a newly
            constructed constrained record subtype, the
            Direct_Primitive_Operations attribute must be copied.

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

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index ed337f5408e..042ace01724 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -14325,6 +14325,8 @@ package body Sem_Ch3 is
       Set_Is_Constrained    (T_Sub, True);
       Set_First_Entity      (T_Sub, First_Entity (Corr_Rec));
       Set_Last_Entity       (T_Sub, Last_Entity  (Corr_Rec));
+      Set_Direct_Primitive_Operations
+        (T_Sub, Direct_Primitive_Operations (Corr_Rec));
 
       if Has_Discriminants (Prot_Subt) then -- False only if errors.
          Set_Discriminant_Constraint

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-01  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-01  8:07 [gcc r14-2902] ada: Bugbox compiling Constrained_Protected_Object'Image Marc Poulhi?s

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).