[Ada] Pragma Unreferenced triggers undefined reference
authorJustin Squirek <squirek@adacore.com>
Thu, 11 Jul 2019 08:02:21 +0000 (08:02 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 11 Jul 2019 08:02:21 +0000 (08:02 +0000)
commitae59bda92bbab1a02562683dd54fb9c287307a9e
tree2fec8a1049e64dc94bc9bf90a5de2a40440b46e9
parent4ae83b58d2316f22d6874b6901fa61fe0f823e3f
[Ada] Pragma Unreferenced triggers undefined reference

This patch corrects the generation of protected body declarations so
that instances of pragma Unreferenced applied to formals don't falsly
trigger undefined references.

2019-07-11  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* exp_ch9.adb (Build_Private_Protected_Declaration): Add
exception for the moving of pragmas to internally generated
specs for pragma Unreferenced.

gcc/testsuite/

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

From-SVN: r273392
gcc/ada/ChangeLog
gcc/ada/exp_ch9.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/unreferenced2.adb [new file with mode: 0644]