Skip to content
Snippets Groups Projects
Commit fd4f48b3 authored by Steve Baird's avatar Steve Baird Committed by Marc Poulhiès
Browse files

ada: Finalization not performed for component of protected type

In some cases involving a discriminated protected type with an array
component that is subject to a discriminant-dependent index constraint,
where the element type of the array requires finalization and the array
type has not yet been frozen at the point of the declaration of the protected
type, finalization of an object of the protected type may incorrectly omit
finalization of the array component. One case where this scenario can arise
is an instantiation of Ada.Containers.Bounded_Synchronized_Queues, passing in
an Element type that requires finalization.

gcc/ada/

	* exp_ch7.adb (Make_Final_Call): Add assertion that if no
	finalization call is generated, then the type of the object being
	finalized does not require finalization.
	* freeze.adb (Freeze_Entity): If freezing an already-frozen
	subtype, do not assume that nothing needs to be done. In the case
	of a frozen subtype of a non-frozen type or subtype (which is
	possible), freeze the non-frozen entity.
parent deebf06a
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