diff options
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index fe0389b6bf9..370bc1df999 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -861,9 +861,19 @@ package body Sem_Attr is procedure Check_Dereference is begin - if Is_Object_Reference (P) - and then Is_Access_Type (P_Type) + + -- Case of a subtype mark + + if Is_Entity_Name (P) + and then Is_Type (Entity (P)) then + return; + end if; + + -- Case of an expression + + Resolve (P); + if Is_Access_Type (P_Type) then Rewrite (P, Make_Explicit_Dereference (Sloc (P), Prefix => Relocate_Node (P))); |