Fix dynamic accessibility check for named access types in Ada 95.
Corrects a bug in Ada 95 dynamic accessibility checks that incorrectly failed for named access types.
This commit fixes a bug in the Ada front-end where the dynamic accessibility check for function calls or allocators in Ada 95 mode was failing incorrectly when the result was a named access type. The fix ensures that named access types are handled consistently with other language versions, restoring the correct behavior for dynamic accessibility checks.
In Details
In ada/accessibility.adb, the function Function_Call_Or_Allocator_Level in Ada 95 mode now correctly handles named access result types. Previously, an overhaul to accessibility level computation overlooked this specific case, causing bogus failures. This change aligns Ada 95 handling of named access types with that of other Ada versions, resolving an issue in dynamic accessibility checking.
- Ada 95
- A version of the Ada programming language, which introduced object-oriented features and other enhancements over Ada 83. It's known for its strong typing and emphasis on safety.
- dynamic accessibility
- In Ada, accessibility refers to the scope or lifetime relationship between types. Dynamic accessibility checks ensure that access types (pointers) do not outlive the objects they point to, preventing dangling pointers at runtime.
- named access type
- In Ada, an access type (similar to a pointer type) that is explicitly declared with a name. This is in contrast to anonymous access types which are defined inline.