Commit d2b73a3e by Ed Schonberg Committed by Pierre-Marie de Rodat

[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
parent f2f9cdad
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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment