[Ada] Avoid spurious warning on wrong order of operator call arguments

Pierre-Marie de Rodat derodat@adacore.com
Thu Jul 11 08:04:00 GMT 2019


GNAT issues a warning under -gnatwa when actuals for a call are named
like the formals, but in a different order. This is inappropriate for
calls to operators in infix form, when e.g. Right <= Left is in general
the intended order. Special case calls to operators to avoid that
spurious warning.

Tested on x86_64-pc-linux-gnu, committed on trunk

2019-07-11  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_res.adb (Check_Argument_Order): Special case calls to
	operators.

gcc/testsuite/

	* gnat.dg/warn21.adb, gnat.dg/warn21.ads: New testcase.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1797 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190711/ac76eb26/attachment.bin>


More information about the Gcc-patches mailing list