+2017-11-16 Sylvain Dailler <dailler@adacore.com>
+
+ * sem_util.adb (Get_Enum_Lit_From_Pos): Add a condition for Pos
+ lower than 0.
+
+2017-11-16 Bob Duff <duff@adacore.com>
+
+ * sem_ch13.adb (Check_Expr_Constants): Avoid error message in case of
+ System'To_Address.
+
2017-11-16 Yannick Moy <moy@adacore.com>
* sem_elab.adb (Include): Fix mode of parameter Curr to out.
then
Check_At_Constant_Address (Prefix (Nod));
+ -- Normally, System'To_Address will have been transformed into
+ -- an Unchecked_Conversion, but in -gnatc mode, it will not,
+ -- and we don't want to give an error, because the whole point
+ -- of 'To_Address is that it is static.
+
+ elsif Attribute_Name (Nod) = Name_To_Address then
+ pragma Assert (Operating_Mode = Check_Semantics);
+ null;
+
else
Check_Expr_Constants (Prefix (Nod));
Check_List_Constants (Expressions (Nod));
end if;
Lit := First_Literal (Btyp);
+
+ -- Position in the enumeration type starts at 0.
+ if UI_To_Int (Pos) < 0 then
+ raise Constraint_Error;
+ end if;
+
for J in 1 .. UI_To_Int (Pos) loop
Next_Literal (Lit);