diff options
author | Ed Schonberg <schonberg@adacore.com> | 2018-07-16 14:11:15 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-07-16 14:11:15 +0000 |
commit | d2b73a3edb85564fce73b916ad7f7c65ea3ef74d (patch) | |
tree | f7769c876083d2280ce3368472a2a7fbccc1ee41 /gcc | |
parent | f2f9cdad15a6eaadb93239092eb4441c535fa387 (diff) | |
download | gcc-d2b73a3edb85564fce73b916ad7f7c65ea3ef74d.zip gcc-d2b73a3edb85564fce73b916ad7f7c65ea3ef74d.tar.gz gcc-d2b73a3edb85564fce73b916ad7f7c65ea3ef74d.tar.bz2 |
[Ada] Add a missing check for trivial predicates on non-discrete types
2018-07-16 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a
static predicate (for example True) but has no
static_discrete_predicate.
From-SVN: r262716
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 59597a3..cd1aac0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-07-16 Ed Schonberg <schonberg@adacore.com> + + * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a + static predicate (for example True) but has no + static_discrete_predicate. + 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 43055e6..9a9c150 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -18615,11 +18615,15 @@ package body Sem_Ch3 is -- A named subtype does not inherit the predicate function of its -- parent but an itype declared for a loop index needs the discrete -- predicate information of its parent to execute the loop properly. + -- A non-discrete type may has a static predicate (for example True) + -- but has no static_discrete_predicate. if Is_Itype (Subt) and then Present (Predicate_Function (Par)) then Set_Subprograms_For_Type (Subt, Subprograms_For_Type (Par)); - if Has_Static_Predicate (Par) then + if Has_Static_Predicate (Par) + and then Is_Discrete_Type (Par) + then Set_Static_Discrete_Predicate (Subt, Static_Discrete_Predicate (Par)); end if; |