[Ada] Fix spurious loop warning for function with Out parameter
commitf3d2fbfdb83bcc60d72824daf7a470c0e5398854
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 22 Jul 2019 13:56:50 +0000 (22 13:56 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 22 Jul 2019 13:56:50 +0000 (22 13:56 +0000)
treeced0090a1981e3808c919aa6723cdb5351d1a48c
parent1a79e03b8012d5094e5bd432df59abeca5c2fe18
[Ada] Fix spurious loop warning for function with Out parameter

The compiler gives a spurious warning about a possible infinite while
loop whose condition contains a call to a function that takes an Out or
In/Out parameter and whose actual is a variable that is not modified in
the loop, because it still thinks that functions can only have In
parameters.

2019-07-22  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* sem_warn.adb (Find_Var): Bail out for a function call with an
Out or In/Out parameter.

gcc/testsuite/

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

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