[Bug ada/124369] [13/14/15/16 regression] missing error for dangling pointer from access discriminant
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 12 17:32:44 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124369
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:d8f49b41b01900751e73a2a01ca22f2246bd9af3
commit r16-8050-gd8f49b41b01900751e73a2a01ca22f2246bd9af3
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Thu Mar 12 18:11:34 2026 +0100
Ada: Fix missing error for dangling pointer from access discriminant
This restores the original computation of the scope depth of the innermost
enclosing master of a given node and performs a couple of other cleanups.
Note that this has uncovered an issue in the ACATS c3a0025 test and the
change contains the modification that has been submitted to the ACAA.
gcc/ada/
PR ada/124369
* accessibility.adb (Accessibility_Message): Give an error instead
of a warning in an instance when No_Dynamic_Accessibility_Checks is
in effect.
(Innermost_Master_Scope_Depth): Restore the original computation of
the nearest enclosing dynamic scope.
* sem_attr.adb (Resolve_Attribute) <Attribute_Access>: Call the
Accessibility_Message routine in all cases to give accessibility
errors and do not return. Call the Static_Accessibility_Level
function in all cases to compute static accessibility levels.
Add guard before calling Prefix_With_Safe_Accessibility_Level.
gcc/testsuite/
* ada/acats-3/tests/c3/c3a0025.a: Tweak.
* ada/acats-4/tests/c3/c3a0025.a: Likewise.
* gnat.dg/access12.adb: New test.
More information about the Gcc-bugs
mailing list