[Ada] Suppress warnings on unreferenced parameters of dispatching ops
authorBob Duff <duff@adacore.com>
Mon, 19 Aug 2019 08:37:23 +0000 (08:37 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 19 Aug 2019 08:37:23 +0000 (08:37 +0000)
commitbfa6962fc25e2e24b3a5299095e933f9b57bb6e0
treee3a0a408bda5ba809d8c1f2321ab06b27d02e2aa
parentfcef060c9b321edcb24a56616588e712c22029ba
[Ada] Suppress warnings on unreferenced parameters of dispatching ops

If the -gnatwf switch is used to activate warnings on unreferenced
formal parameters, the warning is no longer given if the subprogram is
dispatching, because such warnings tend to be noise. It is quite common
to have a parameter that is necessary just because the subprogram is
overriding, or just because we need a controlling parameter for the
dispatch.

2019-08-19  Bob Duff  <duff@adacore.com>

gcc/ada/

* sem_warn.adb (Warn_On_Unreferenced_Entity): Suppress warning
on formal parameters of dispatching operations.

gcc/testsuite/

* gnat.dg/warn29.adb, gnat.dg/warn29.ads: New testcase.

From-SVN: r274663
gcc/ada/ChangeLog
gcc/ada/sem_warn.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/warn29.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/warn29.ads [new file with mode: 0644]