[Ada] Warn on slices of the form A (subtype) for all objects

gcc/ada/

	* sem_eval.adb (Eval_Slice): Emit warning not just for
	constants, but for any objects.
This commit is contained in:
Piotr Trojanek 2020-04-15 22:53:54 +02:00 committed by Pierre-Marie de Rodat
parent 433b2e91f9
commit 81c629f8f1

View File

@ -3961,7 +3961,7 @@ package body Sem_Eval is
T : constant Entity_Id := Etype (E);
begin
if Ekind (E) = E_Constant
if Is_Object (E)
and then Is_Array_Type (T)
and then Is_Entity_Name (Drange)
then