aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 92e1b9d..16bfbeb 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -4064,6 +4064,19 @@ package body Sem_Ch3 is
T := Process_Subtype (Subtype_Indication (N), N, Id, 'P');
+ -- Class-wide equivalent types of records with unknown discriminants
+ -- involve the generation of an itype which serves as the private view
+ -- of a constrained record subtype. In such cases the base type of the
+ -- current subtype we are processing is the private itype. Use the full
+ -- of the private itype when decorating various attributes.
+
+ if Is_Itype (T)
+ and then Is_Private_Type (T)
+ and then Present (Full_View (T))
+ then
+ T := Full_View (T);
+ end if;
+
-- Inherit common attributes
Set_Is_Generic_Type (Id, Is_Generic_Type (Base_Type (T)));