From: Piotr Trojanek Date: Mon, 21 Dec 2020 23:58:21 +0000 (+0100) Subject: [Ada] Check entries for formals of mode IN appearing as global outputs X-Git-Tag: upstream/12.2.0~8290 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98a54aa50496f5c403ad34e5ef4e758945666be5;p=platform%2Fupstream%2Fgcc.git [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. --- 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);