[Ada] Fix crash on type extensions with discriminants

gcc/ada/

	* exp_put_image.adb (Make_Component_Attributes): Use
	Implementation_Base_Type to get the parent type. Otherwise,
	Parent_Type_Decl is actually an internally generated subtype
	declaration, so we blow up on
	Type_Definition (Parent_Type_Decl).
This commit is contained in:
Bob Duff 2021-06-15 15:36:34 -04:00 committed by Pierre-Marie de Rodat
parent bb66a10215
commit f377685e3d

View File

@ -658,8 +658,8 @@ package body Exp_Put_Image is
if Chars (Defining_Identifier (Item)) = Name_uParent then
declare
Parent_Type : constant Entity_Id :=
Underlying_Type (Base_Type (
(Etype (Defining_Identifier (Item)))));
Implementation_Base_Type
(Etype (Defining_Identifier (Item)));
Parent_Aspect_Spec : constant Node_Id :=
Find_Aspect (Parent_Type, Aspect_Put_Image);