[Ada] Visibility error on used enumerated type
authorJustin Squirek <squirek@adacore.com>
Wed, 14 Nov 2018 11:41:09 +0000 (11:41 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 14 Nov 2018 11:41:09 +0000 (11:41 +0000)
commit7f0f5de19093d4550b48d3a26f1869e8def3f7e8
treeb276ce52e71a384ada6830fbeffcd3292664a52e
parent39b763713cdc656911944ea56225f77e9f27d4e3
[Ada] Visibility error on used enumerated type

This patch fixes an issue whereby the freezing of a nested package
containing an enumerated type declaration would cause visibility errors
on literals of such type when a use_all_type_clause for it appears
within the same declarative region.

2018-11-14  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* sem_ch7.adb (Uninstall_Declarations): Add conditional to avoid
uninstalling potential visibility during freezing on enumeration
literals.

gcc/testsuite/

* gnat.dg/enum5.adb: New testcase.

From-SVN: r266119
gcc/ada/ChangeLog
gcc/ada/sem_ch7.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/enum5.adb [new file with mode: 0644]