]> gcc.gnu.org Git - gcc.git/commitdiff
ada: Bugbox compiling Constrained_Protected_Object'Image
authorSteve Baird <baird@adacore.com>
Thu, 8 Jun 2023 22:08:11 +0000 (15:08 -0700)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 1 Aug 2023 08:06:45 +0000 (10:06 +0200)
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.

gcc/ada/sem_ch3.adb

index ed337f5408ecb12222593a57f847c4594ae7003d..042ace017242ab99d6397e411a72aff8cf40668d 100644 (file)
@@ -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
This page took 0.083665 seconds and 5 git commands to generate.