+2019-08-20 Bob Duff <duff@adacore.com>
+
+ * sem_eval.adb (Expr_Value): Implement the case of an unchecked
+ conversion of a static expression.
+
2019-08-20 Bob Duff <duff@adacore.com>
* sem_ch13.adb (Is_Null_Array): New function, used to detect the
pragma Assert (Is_Access_Type (Underlying_Type (Etype (N))));
Val := Uint_0;
- -- Otherwise must be character literal
+ -- Character literal
- else
- pragma Assert (Kind = N_Character_Literal);
+ elsif Kind = N_Character_Literal then
Ent := Entity (N);
-- Since Character literals of type Standard.Character don't
else
Val := Enumeration_Pos (Ent);
end if;
+
+ -- Unchecked conversion, which can come from System'To_Address (X)
+ -- where X is a static integer expression. Recursively evaluate X.
+
+ elsif Kind = N_Unchecked_Type_Conversion then
+ Val := Expr_Value (Expression (N));
+
+ else
+ raise Program_Error;
end if;
-- Come here with Val set to value to be returned, set cache