From 98a54aa50496f5c403ad34e5ef4e758945666be5 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 22 Dec 2020 00:58:21 +0100 Subject: [PATCH] [Ada] Check entries for formals of mode IN appearing as global outputs gcc/ada/ * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Extend check to protected entries. --- gcc/ada/sem_prag.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 3009421..b13894c 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -2634,7 +2634,7 @@ package body Sem_Prag is Context := Anonymous_Object (Context); end if; - if (Is_Subprogram (Context) + if (Is_Subprogram_Or_Entry (Context) or else Ekind (Context) = E_Task_Type or else Is_Single_Task_Object (Context)) and then @@ -2659,7 +2659,7 @@ package body Sem_Prag is ("global item & cannot have mode In_Out or Output", Item, Item_Id); - if Is_Subprogram (Context) then + if Is_Subprogram_Or_Entry (Context) then SPARK_Msg_NE (Fix_Msg (Subp_Id, "\item already appears as input " & "of subprogram &"), Item, Context); -- 2.7.4