aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2025-03-19 08:22:33 +0100
committerEric Botcazou <ebotcazou@adacore.com>2025-03-19 08:29:11 +0100
commit278715f255d07ae955cb2c0519b8f1233dfc6bf9 (patch)
tree18c0269232d16ca0a79b81e2d72255a4e1d9ebb2 /gcc/c
parentd0110185eb78f14a8e485f410bee237c9c71548d (diff)
downloadgcc-278715f255d07ae955cb2c0519b8f1233dfc6bf9.zip
gcc-278715f255d07ae955cb2c0519b8f1233dfc6bf9.tar.gz
gcc-278715f255d07ae955cb2c0519b8f1233dfc6bf9.tar.bz2
Fix spurious visibility error with partially parameterized formal package
This is not a regression but the issue is quite annoying and the fix is trivial. The problem is that a formal parameter covered by a box in the formal package is not visible in the instance when it comes after another formal parameter that is also a formal package. It comes from a discrepancy internal to Instantiate_Formal_Package, where a specific construct (the abbreviated instance) built for the nested formal package discombobulates the processing done for the outer formal package. gcc/ada/ * gen_il-gen-gen_nodes.adb (N_Formal_Package_Declaration): Use N_Declaration instead of Node_Kind as ancestor. * sem_ch12.adb (Get_Formal_Entity): Remove obsolete alternative. (Instantiate_Formal_Package): Take into account the abbreviated instances in the main loop running over the actuals of the local package created for the formal package. gcc/testsuite/ * gnat.dg/generic_inst14.adb: New test. * gnat.dg/generic_inst14_pkg.ads: New helper. * gnat.dg/generic_inst14_pkg-child.ads: Likewise.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions