2019-12-12 Bob Duff <duff@adacore.com>
gcc/ada/
* sem_attr.adb (Eval_Attribute): Never mark T'Descriptor_Size as
static, even if T is a static subtype, because otherwise we will
request the value of the attribute, which will crash because we
have not evaluated it.
From-SVN: r279287
+2019-12-12 Bob Duff <duff@adacore.com>
+
+ * sem_attr.adb (Eval_Attribute): Never mark T'Descriptor_Size as
+ static, even if T is a static subtype, because otherwise we will
+ request the value of the attribute, which will crash because we
+ have not evaluated it.
+
2019-12-12 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb (Expand_N_Assognment_Statement): Extend the
-- is legal, since here this expression appears in a statically
-- unevaluated position, so it does not actually raise an exception.
+ --
+ -- T'Descriptor_Size is never static, even if T is static.
if Is_Scalar_Type (P_Entity)
and then (not Is_Generic_Type (P_Entity))
(No (E2)
or else (Is_Static_Expression (E2)
and then Is_Scalar_Type (Etype (E1))))
+ and then Id /= Attribute_Descriptor_Size
then
Static := True;
Set_Is_Static_Expression (N, True);