The Global and Depends contracts can only be attached to single task
objects, not to single protected objects.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-15  Piotr Trojanek  <troja...@adacore.com>

gcc/ada/

        * contracts.adb (Analyze_Object_Contract): Do not expect
        Global/Depends on single protected units.
--- gcc/ada/contracts.adb
+++ gcc/ada/contracts.adb
@@ -1067,10 +1067,10 @@ package body Contracts is
             Analyze_External_Property_In_Decl_Part (Prag, NC_Val);
          end if;
 
-         --  The anonymous object created for a single concurrent type carries
-         --  pragmas Depends and Globat of the type.
+         --  The anonymous object created for a single task type carries
+         --  pragmas Depends and Global of the type.
 
-         if Is_Single_Concurrent_Object (Obj_Id) then
+         if Is_Single_Task_Object (Obj_Id) then
 
             --  Analyze Global first, as Depends may mention items classified
             --  in the global categorization.

Reply via email to