diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 04107a5c9df1158d40a974cb8ca90a95de0250ae..4d3577e8ea02cd4622b089bee297c1c7e800935f 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -4074,7 +4074,9 @@ package body Sem_Util is else case Nkind (N) is when N_Indexed_Component | N_Slice => - return Is_Object_Reference (Prefix (N)); + return + Is_Object_Reference (Prefix (N)) + or else Is_Access_Type (Etype (Prefix (N))); -- In Ada95, a function call is a constant object @@ -4089,7 +4091,9 @@ package body Sem_Util is when N_Selected_Component => return Is_Object_Reference (Selector_Name (N)) - and then Is_Object_Reference (Prefix (N)); + and then + (Is_Object_Reference (Prefix (N)) + or else Is_Access_Type (Etype (Prefix (N)))); when N_Explicit_Dereference => return True;