GNAT failed to issue an error on a Global/Depends aspect put on an object
declaration, which is only allowed for a task object. Instead it crashed.
Now fixed.

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

2017-09-06  Yannick Moy  <m...@adacore.com>

        * sem_prag.adb (Analyze_Depends_Global): Reinforce test on object
        declarations to only consider valid uses of Global/Depends those on
        single concurrent objects.

Index: sem_prag.adb
===================================================================
--- sem_prag.adb        (revision 251778)
+++ sem_prag.adb        (working copy)
@@ -4080,7 +4080,10 @@
 
          --  Object declaration of a single concurrent type
 
-         elsif Nkind (Subp_Decl) = N_Object_Declaration then
+         elsif Nkind (Subp_Decl) = N_Object_Declaration
+           and then Is_Single_Concurrent_Object
+                      (Unique_Defining_Entity (Subp_Decl))
+         then
             null;
 
          --  Single task type

Reply via email to