Ada: Fix assertion failure on invalid String_Literal aspect.
The Ada compiler no longer crashes when encountering an invalid `String_Literal` aspect.
The Ada compiler could trigger an assertion failure when processing an invalid String_Literal aspect. This commit fixes this issue by preventing subprograms declared in the body from being incorrectly considered as primitive operations of a type declared in a package specification. This fix prevents a compiler crash and improves the robustness of the Ada compiler.
In Details
The assertion failure occurred because a subprogram declared in a package body was incorrectly identified as a primitive operation of a type declared in the package specification. The fix involves changes to einfo.ads, sem_ch3.adb, sem_ch6.adb, and sem_util.adb to correctly compute In_Package_Body and In_Private_Part and to skip subprograms declared in the body when collecting primitive operations.
For Context
In Ada, an aspect is a property of an entity. This commit fixes a bug in the Ada compiler that could cause it to crash when handling the String_Literal aspect, which specifies how string literals are represented. The crash occurred because the compiler was incorrectly identifying subprograms as primitive operations. This commit corrects the identification process, preventing the crash and making the compiler more stable.