summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-04 09:55:03 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-04 09:55:03 +0000
commitd02513399b3ef2bbfb9b6b7342c5a6f71bed1fa4 (patch)
tree3f5c379f93247973716c19843bf424726be37cb0 /gcc/ada/sem_res.adb
parent008ad8451d3a598ca302f9b6f7bcb092fdd2778f (diff)
downloadgcc-d02513399b3ef2bbfb9b6b7342c5a6f71bed1fa4.tar.gz
2011-08-04 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb, sem_ch4.adb: move check for restriction No_Task_Hierarchy to resolve_allocator. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177350 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 56f1457140e..753b10241e3 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -4307,6 +4307,15 @@ package body Sem_Res is
Check_Restriction (No_Anonymous_Allocators, N);
end if;
+ -- Check that an allocator with task parts isn't for a nested access
+ -- type when restriction No_Task_Hierarchy applies.
+
+ if not Is_Library_Level_Entity (Base_Type (Typ))
+ and then Has_Task (Base_Type (Designated_Type (Typ)))
+ then
+ Check_Restriction (No_Task_Hierarchy, N);
+ end if;
+
-- An erroneous allocator may be rewritten as a raise Program_Error
-- statement.