gnu/gcc/cda2d997ce6c6f109a97ba2ad239eeb461c12cf5 ada: Fix assertion failure on library procedure
The Build_And_Insert_Type_Attr_Subp procedure sometimes uses the
declaration list of a subprogram body ancestor even when the point of
reference is inside the statement list. Before this patch, this caused
an assertion failure (and a failure to hoist with assertions disabled)
when the declaration list of the body was empty. This patch fixes this.
gcc/ada/ChangeLog:
* exp_attr.adb (Spot, Spot_Kind): New types.
(Build_And_Insert_Type_Attr_Subp, Skip_Non_Source_Subps,
Find_Insertion_Point_For_Ancestor): Handle case of empty body
declaration list.
1 file changed