r273694 - in /trunk/gcc: ada/ChangeLog ada/exp_...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Mon Jul 22 13:58:00 GMT 2019


Author: pmderodat
Date: Mon Jul 22 13:58:27 2019
New Revision: 273694

URL: https://gcc.gnu.org/viewcvs?rev=273694&root=gcc&view=rev
Log:
[Ada] Remove misleading warning/suggestion in membership test

This patch removes a warning on a membership test whose right operand is
given by a range. In many cases the check can be replaced by the use of
attribute 'Valid, but if the bounds of range are type conversion this
replacement would be invorrect and the warning and suggestion are
misleading.

2019-07-22  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* exp_ch4.adb (Expand_N_In): Do not suggest the use of attribute
	'Valid as a replacement for a range check on a discrete type
	when the bounds of the range are given by type conversions,
	because in such a case there are distinct types involved and the
	subbested attribute replacement would be misplaced.

gcc/testsuite/

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

Added:
    trunk/gcc/testsuite/gnat.dg/warn26.adb
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/exp_ch4.adb
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list