[Ada] Allow attributes Version and Body_Version prefixed by entries
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 23 Dec 2020 23:54:40 +0000 (00:54 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 3 May 2021 09:28:24 +0000 (05:28 -0400)
gcc/ada/

* sem_attr.adb (Check_Program_Unit): Replace tests for Task_Kind
and Protected_Kind with a collective test for Concurrent_Kind;
likewise, replace calls to Is_Task_Type and Is_Protected_Type
with a collective call to Is_Concurrent_Type; simplify into a
single membership test; add missing Entry_Kind alternative.

gcc/ada/sem_attr.adb

index 9d96ee1..a9d095d 100644 (file)
@@ -2302,16 +2302,12 @@ package body Sem_Attr is
                T : constant Entity_Id   := Etype (Entity (P));
 
             begin
-               if K in Subprogram_Kind
-                 or else K in Task_Kind
-                 or else K in Protected_Kind
-                 or else K = E_Package
-                 or else K in Generic_Unit_Kind
-                 or else (K = E_Variable
-                            and then
-                              (Is_Task_Type (T)
-                                 or else
-                               Is_Protected_Type (T)))
+               if K in Concurrent_Kind
+                     | Entry_Kind
+                     | Generic_Unit_Kind
+                     | Subprogram_Kind
+                     | E_Package
+                 or else (K = E_Variable and then Is_Concurrent_Type (T))
                then
                   return;
                end if;