Skip to content
Snippets Groups Projects
Commit 46640baf authored by Pascal Obry's avatar Pascal Obry Committed by Marc Poulhiès
Browse files

ada: Default Put_Image for composite derived types is missing information

The output generated by a call to Some_Derived_Composite_Type'Put_Image
(in Ada2022 code) is incomplete in some cases, notably for a type derived
from a container type (i.e., from the Set/Map/List/Vector type declared in
an instance of one of Ada's predefined container generics) with no
user-specified Put_Image procedure.

gcc/ada/

	* aspects.ads (Find_Aspect): Add Boolean parameter Or_Rep_Item
	(defaulted to False).
	* aspects.adb (Find_Aspect): If new Boolean parameter Or_Rep_Item
	is True, then instead of returning an empty result if no
	appropriate N_Aspect_Specification node is found, return an
	appropriate N_Attribute_Definition_Clause if one is found.
	* exp_put_image.ads: Change name of Enable_Put_Image function to
	Put_Image_Enabled.
	* exp_put_image.adb (Build_Record_Put_Image_Procedure): Detect the
	case where a call to the Put_Image procedure of a derived type can
	be transformed into a call to the parent type's Put_Image
	procedure (with a type conversion to the parent type as the actual
	parameter).
	(Put_Image_Enabled): Change name of function (previously
	Enable_Put_Image). Return True in more cases. In particular,
	return True for a type with an explicitly specified Put_Image
	aspect even if the type is declared in a predefined unit (or in an
	instance of a predefined generic unit).
	* exp_attr.adb: Changes due to Put_Image_Enabled function name
	change.
parent f9b03ef7
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment