aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 7112869f4a8..eaaeb15f136 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -9993,6 +9993,9 @@ package body Sem_Attr is
-- to a missed warning (the Valid check does not really
-- modify!) If this case, Note will be reset to False.
+ -- Skip it as well if the type is an Acccess_To_Constant,
+ -- given that no use of the value can modify the prefix.
+
begin
if Attr_Id = Attribute_Unrestricted_Access
and then Nkind (PN) = N_Function_Call
@@ -10006,6 +10009,9 @@ package body Sem_Attr is
then
Note := False;
end if;
+
+ elsif Is_Access_Constant (Typ) then
+ Note := False;
end if;
if Note then