+2014-07-16 Yannick Moy <moy@adacore.com>
+
+ * sem_attr.adb (Analyze_Attribute/cases Pred
+ and Succ): Always enable range check on fixed-point types if
+ not suppressed for the type.
+
+2014-07-16 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_util.adb (State_Has_Enabled_Property):
+ Account for an external property denoted by an others choice.
+
2014-07-16 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch4.ads, exp_ch4.adb (Find_Hook_Context): Relocated to Exp_Util.
Resolve (E1, P_Base_Type);
Set_Etype (N, P_Base_Type);
- -- For real types, enable range check in Check_Overflow_Mode only
+ -- For floating-point types, enable range check in
+ -- Check_Float_Overflow mode only.
- if Is_Real_Type (P_Type) then
+ if Is_Floating_Point_Type (P_Type) then
if Check_Float_Overflow
and then not Range_Checks_Suppressed (P_Base_Type)
then
Resolve (E1, P_Base_Type);
Set_Etype (N, P_Base_Type);
- -- For real types, enable range check in Check_Overflow_Mode only
+ -- For floating-point types, enable range check in
+ -- Check_Float_Overflow mode only.
- if Is_Real_Type (P_Type) then
+ if Is_Floating_Point_Type (P_Type) then
if Check_Float_Overflow
and then not Range_Checks_Suppressed (P_Base_Type)
then
while Present (Prop) loop
Prop_Nam := First (Choices (Prop));
- if Chars (Prop_Nam) = Property then
+ -- The property can be represented in two ways:
+ -- others => <value>
+ -- <property> => <value>
+
+ if Nkind (Prop_Nam) = N_Others_Choice
+ or else (Nkind (Prop_Nam) = N_Identifier
+ and then Chars (Prop_Nam) = Property)
+ then
return Is_True (Expr_Value (Expression (Prop)));
end if;