https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115666
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eric Botcazou <[email protected]>: https://gcc.gnu.org/g:4954f55c959aea62a8c7c0282804752a2a107178 commit r17-6588-g4954f55c959aea62a8c7c0282804752a2a107178 Author: Eric Botcazou <[email protected]> Date: Mon Nov 23 10:02:47 2026 +0100 Ada: Fix missing error on illegal use of access-to-subprogram parameter More precisely, illegal use of access parameter with access-to-subprogram type as a named access-to-subprogram value. Such access parameters have an accessibility level "deeper than that of any master" per RM 3.10.2(13.1) and all of them "have this same level" so, in particular, they cannot be reused as named access-to-subprogram values. This is enforced in the case of an assignment statement, but not in other cases. gcc/ada PR ada/115666 * sem_ch5.adb (Analyze_Assignment): In Ada 2005 and later, do not add an implicit conversion when the RHS is of an anonymous access- to-subprogram type here... * sem_res.adb (Resolve): ...but here instead. (Valid_Conversion): Fix reference to RM rule in error message. gcc/testsuite/ * gnat.dg/access13.ads, gnat.dg/access13.adb: New test.
