Do not call Set_Cloned_Subtype on private type
commit3104dbdcf4a2b7766b5570a0fa2d30157082f04e
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 2 Mar 2021 00:04:10 +0000 (2 01:04 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Tue, 2 Mar 2021 00:05:38 +0000 (2 01:05 +0100)
treef354c8ae313c915897c2f9bd5cf7e0a0b88ce078
parent491d5b3cf8216f9285a67aa213b9a66b0035137b
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.
gcc/ada/sem_ch3.adb