diff options
author | Ed Schonberg <schonberg@adacore.com> | 2011-08-04 09:55:03 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-04 11:55:03 +0200 |
commit | 6aaa058707f9d29c01aae3c7823a3d184d0e777f (patch) | |
tree | 3f5c379f93247973716c19843bf424726be37cb0 /gcc | |
parent | 35a1c212918d3b4c0f0bb75a652038152e8396d1 (diff) | |
download | gcc-6aaa058707f9d29c01aae3c7823a3d184d0e777f.zip gcc-6aaa058707f9d29c01aae3c7823a3d184d0e777f.tar.gz gcc-6aaa058707f9d29c01aae3c7823a3d184d0e777f.tar.bz2 |
sem_res.adb, [...]: move check for restriction No_Task_Hierarchy to resolve_allocator.
2011-08-04 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb, sem_ch4.adb: move check for restriction
No_Task_Hierarchy to resolve_allocator.
From-SVN: r177350
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/sem_ch4.adb | 7 | ||||
-rw-r--r-- | gcc/ada/sem_res.adb | 9 |
3 files changed, 14 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b90a4ac..827850e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2011-08-04 Ed Schonberg <schonberg@adacore.com> + + * sem_res.adb, sem_ch4.adb: move check for restriction + No_Task_Hierarchy to resolve_allocator. + 2011-08-04 Thomas Quinot <quinot@adacore.com> * sinfo.adb, sinfo.ads, sem_prag.adb, sem_ch12.adb (Pragma_Enabled): diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 6aa3ae9..2025224 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -654,13 +654,6 @@ package body Sem_Ch4 is Check_Restriction (No_Tasking, N); Check_Restriction (Max_Tasks, N); Check_Restriction (No_Task_Allocators, N); - - -- 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 (Acc_Type) then - Check_Restriction (No_Task_Hierarchy, N); - end if; end if; -- Check that an allocator of a nested access type doesn't create a diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 56f1457..753b102 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. |