From: Piotr Trojanek Date: Wed, 1 Apr 2020 16:19:40 +0000 (+0200) Subject: [Ada] Do expect task discriminants in Global and Depends contracts X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=65e088926639654e51b8e85be481d586505b56b4;p=gcc.git [Ada] Do expect task discriminants in Global and Depends contracts 2020-06-15 Piotr Trojanek gcc/ada/ * sem_prag.adb (Analyze_Depends_In_Decl_Part, Analyze_Global_In_Decl_Part): Bring back task discriminants for analysis of the Global/Depends contracts; add comments. --- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index eb374c4bb7a..673954acb5b 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -2001,7 +2001,14 @@ package body Sem_Prag is Push_Scope (Spec_Id); if Ekind (Spec_Id) = E_Task_Type then - null; + + -- Task discriminants cannot appear in the [Refined_]Depends + -- contract, but must be present for the analysis so that we + -- can reject them with an informative error message. + + if Has_Discriminants (Spec_Id) then + Install_Discriminants (Spec_Id); + end if; elsif Is_Generic_Subprogram (Spec_Id) then Install_Generic_Formals (Spec_Id); @@ -2789,7 +2796,14 @@ package body Sem_Prag is Push_Scope (Spec_Id); if Ekind (Spec_Id) = E_Task_Type then - null; + + -- Task discriminants cannot appear in the [Refined_]Global + -- contract, but must be present for the analysis so that we + -- can reject them with an informative error message. + + if Has_Discriminants (Spec_Id) then + Install_Discriminants (Spec_Id); + end if; elsif Is_Generic_Subprogram (Spec_Id) then Install_Generic_Formals (Spec_Id);