summaryrefslogtreecommitdiffstats
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.adb7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 5efa6896370..789cb4763d4 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -4939,12 +4939,15 @@ package body Sem_Attr is
-- all scope checks and checks for aliased views are omitted.
when Attribute_Unrestricted_Access =>
+
+ -- If from source, deal with relevant restrictions
+
if Comes_From_Source (N) then
Check_Restriction (No_Unchecked_Access, N);
if Nkind (P) in N_Has_Entity
- and then Present (Entity (P))
- and then Is_Object (Entity (P))
+ and then Present (Entity (P))
+ and then Is_Object (Entity (P))
then
Check_Restriction (No_Implicit_Aliasing, N);
end if;
OpenPOWER on IntegriCloud