Skip to content
Snippets Groups Projects
Commit 3716d988 authored by Eric Botcazou's avatar Eric Botcazou Committed by Marc Poulhiès
Browse files

ada: Fix minor fallout of previous changes to aggregate expansion

The problem occurs for an anonymous array object declared with an aspect and
when pragma {Initialize,Normalize}_Scalars is in effect: in this case, the
synthesized aggregate is attached to the Initialization_Statements field by
Convert_Aggr_In_Object_Decl, but Explode_Initialization_Compound_Statement
puts it back at the point of declaration instead of the freeze point, thus
voiding the effects of the mechanism.

This was previously hidden because of a bypass in Freeze_Entity which drops
the freeze node on the floor in this case, so the change fixes the issue and
removes the bypass in the process.

gcc/ada/ChangeLog:

	* freeze.ads (Explode_Initialization_Compound_Statement): Adjust the
	description.
	* freeze.adb (Explode_Initialization_Compound_Statement): If the
	entity has its freezing delayed, append the initialization actions
	to its freeze actions.
	(Freeze_Object_Declaration): Remove commented out code.
	(Freeze_Entity): Remove bypass for object of anonymous array type.
parent 6a784959
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