===================================================================
@@ -12806,12 +12806,14 @@
Is_Variable_Prefix (Original_Node (Prefix (N)));
-- in Ada 2012, the dereference may have been added for a type with
- -- a declared implicit dereference aspect.
+ -- a declared implicit dereference aspect. Check that it is not an
+ -- access to constant.
elsif Nkind (N) = N_Explicit_Dereference
and then Present (Etype (Orig_Node))
and then Ada_Version >= Ada_2012
and then Has_Implicit_Dereference (Etype (Orig_Node))
+ and then not Is_Access_Constant (Etype (Prefix (N)))
then
return True;