enum_val1.adb
447 Bytes
-
[Ada] Fix missing Constraint_Error for Enum_Val attribute · fd90c808
This fixes an old issue involving the Enum_Val attribute: it does not always raise a Constraint_Error exception when the specified value is not valid for the enumeration type (instead a modulo computation is applied to the value). 2019-07-22 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference) <Attribute_Enum_Val>: Set No_Truncation on the N_Unchecked_Type_Conversion built around the argument passed to the attribute. gcc/testsuite/ * gnat.dg/enum_val1.adb: New testcase. From-SVN: r273676
Eric Botcazou committed