aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2021-03-02 01:04:10 +0100
committerEric Botcazou <ebotcazou@adacore.com>2021-03-02 01:05:38 +0100
commit3104dbdcf4a2b7766b5570a0fa2d30157082f04e (patch)
treef354c8ae313c915897c2f9bd5cf7e0a0b88ce078
parent491d5b3cf8216f9285a67aa213b9a66b0035137b (diff)
downloadgcc-3104dbdcf4a2b7766b5570a0fa2d30157082f04e.zip
gcc-3104dbdcf4a2b7766b5570a0fa2d30157082f04e.tar.gz
gcc-3104dbdcf4a2b7766b5570a0fa2d30157082f04e.tar.bz2
Do not call Set_Cloned_Subtype on private type
Build_Discriminated_Subtype may be invoked on a E_Record_Type_With_Private, in which case it builds a E_Record_Subtype_With_Private which does not have the Cloned_Subtype field. gcc/ada/ PR ada/99020 * sem_ch3.adb (Build_Discriminated_Subtype): Set the Cloned_Subtype only if the type is not private.
-rw-r--r--gcc/ada/sem_ch3.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index c01bce1..4c7b8e7 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -10493,7 +10493,7 @@ package body Sem_Ch3 is
then
Create_Constrained_Components (Def_Id, Related_Nod, T, Elist);
- else
+ elsif not Is_Private_Type (T) then
Set_Cloned_Subtype (Def_Id, T);
end if;
end if;