]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sem_res.adb, [...]: move check for restriction No_Task_Hierarchy to resolve_allocator.
authorEd Schonberg <schonberg@adacore.com>
Thu, 4 Aug 2011 09:55:03 +0000 (09:55 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 4 Aug 2011 09:55:03 +0000 (11:55 +0200)
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

gcc/ada/ChangeLog
gcc/ada/sem_ch4.adb
gcc/ada/sem_res.adb

index b90a4acf39030f6ec8ca6643d1aa806f496d68ed..827850e73df23292e38e463e7a7a574ce0c079c9 100644 (file)
@@ -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):
index 6aa3ae9f7c09be9966b1d7edbd4a4de3d72914ee..2025224d3ddd74d0547aa935ecf9f3442235d2f1 100644 (file)
@@ -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
index 56f1457140e9ac37a8bce082f9473c5c76ee5f79..753b10241e3a120c2ab4f07afb0eb66cff12bcd5 100644 (file)
@@ -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.