]> git.ipfire.org Git - thirdparty/gcc.git/commit
Ada: Fix ineffective "use all" clause for type declared in nested package
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 4 Oct 2025 09:28:27 +0000 (11:28 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Sat, 4 Oct 2025 09:32:03 +0000 (11:32 +0200)
commit70639fc6067b315b3527e17077eba72b74eb42b4
tree261be2ece17018360cb8d1b4dc9cf379ef74cdb9
parent68073785e85857cf26d1b78bf2ac2f3e1af63e1b
Ada: Fix ineffective "use all" clause for type declared in nested package

This is an issue reported 10 years ago for a new feature introduced in the
language 20 years ago (Ada 2005): primitive subprograms of a type named in
an use-all-type clause are not seen as (potentially) use-visible if the type
is declared in a nested package, except in the specific case of enumeration
literals; the fix just extends the processing done for enumeration literals.

gcc/ada/
PR ada/64869
* sem_ch7.adb (Install_Private_Declarations): Also propagate the
Current_Use_Clause from partial to full view.
(Uninstall_Declarations): Extend implementation of RM 8.4(8.1/3)
subclause to all primitive subprograms.

gcc/testsuite/
* gnat.dg/use_type1.adb: New test.
* gnat.dg/use_type2.adb: Likewise.
gcc/ada/sem_ch7.adb
gcc/testsuite/gnat.dg/use_type1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/use_type2.adb [new file with mode: 0644]