[Ada] Missing accessibility check on discrim assignment
authorJustin Squirek <squirek@adacore.com>
Wed, 18 Sep 2019 08:33:17 +0000 (08:33 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 18 Sep 2019 08:33:17 +0000 (08:33 +0000)
commit1b2f53bb9ad9c903a126bbe5d6c5672550a54c13
tree71cccea541240554e1416fa7646d067732d06efb
parent6951cbc9e7646bca1c99c973815e6838a6e1fe25
[Ada] Missing accessibility check on discrim assignment

This patch fixes an issue whereby assignments from anonymous access
descriminants which are part of stand alone objects of anonymous access
did not have runtime checks generated based on the accessibility level
of the object according to ARM 3.10.2 (12.5/3).

2019-09-18  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* exp_ch4.adb (Expand_N_Type_Conversion): Add calculation of an
alternative operand for the purposes of generating accessibility
checks.

gcc/testsuite/

* gnat.dg/access8.adb, gnat.dg/access8_pkg.adb,
gnat.dg/access8_pkg.ads: New testcase.

From-SVN: r275860
gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/access8.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/access8_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/access8_pkg.ads [new file with mode: 0644]