gnu/gcc/c8cf35fe67f80f829d924e10b1fd2bb2390c3684 ada: Fix assertion failure on access to uninitialized package entity
It occurs during the analysis of a generic package declared in a structural
instance of a parent generic package, on accessing the uninitialized entity
of the current semantic unit. But this access is unnecessary because what
happens within an instance does not affect the current semantic unit here.
The change also adds the missing call to Unit_Requires_Body already present
in the generic subprogram case to the generic package case.
gcc/ada/ChangeLog:
* sem_ch12.adb (Analyze_Generic_Package_Declaration): Do not set the
Body_Needed_For_Inlining flag on the current semantic unit if the
package is declared within an instance or does not require a body.
(Analyze_Generic_Subprogram_Declaration): Similarly, do not set the
Body_Needed_For_Inlining flag on the current semantic unit if the
subprogram is declared within an instance.
1 file changed