public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] [Ada] Do expect task discriminants in Global and Depends contracts
@ 2020-08-22 22:34 Giuliano Belinassi
  0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 22:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c4931663814f0c5679e67363e72d699e1ee5aba4

commit c4931663814f0c5679e67363e72d699e1ee5aba4
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Wed Apr 1 18:19:40 2020 +0200

    [Ada] Do expect task discriminants in Global and Depends contracts
    
    2020-06-15  Piotr Trojanek  <trojanek@adacore.com>
    
    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:
---
 gcc/ada/sem_prag.adb | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-22 22:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 22:34 [gcc/devel/autopar_devel] [Ada] Do expect task discriminants in Global and Depends contracts Giuliano Belinassi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).