2012-11-06 Gary Dismukes <dismukes@adacore.com>
commitaae8e59257dcb23d8c0935883ae8d6123242e318
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Nov 2012 10:22:42 +0000 (6 10:22 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Nov 2012 10:22:42 +0000 (6 10:22 +0000)
treeb41ad66af2ac765d8c0d188a4f2e96c2fe27d1f4
parentf6aa36b95e2607c6fbeccb22230fc5dd9d8486d4
2012-11-06  Gary Dismukes  <dismukes@adacore.com>

* exp_attr.adb (Expand_N_Attribute_Reference): Apply a predicate
check when evaluating the attribute Valid, and issue a warning
about infinite recursion when the check occurs within the
predicate function of the prefix's subtype.
* exp_ch4.adb (Expand_N_In): Remove test for Is_Discrete_Type
when we're checking that there's no predicate check function as a
condition for substituting a Valid check for a scalar membership
test (substitution should be suppressed for any kind of scalar
subtype with a predicate check). Also, don't emit a predicate
check when the right operand is a range.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193228 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/exp_attr.adb
gcc/ada/exp_ch4.adb