public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/guojiufu/heads/personal-branch)] [Ada] Spurious error on address clause in task body
@ 2020-06-10  3:40 Jiu Fu Guo
  0 siblings, 0 replies; only message in thread
From: Jiu Fu Guo @ 2020-06-10  3:40 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2107ca0242fdbe6f21c9c33c0fd1b812ae944404

commit 2107ca0242fdbe6f21c9c33c0fd1b812ae944404
Author: Ed Schonberg <schonberg@adacore.com>
Date:   Fri Jan 31 12:28:21 2020 -0500

    [Ada] Spurious error on address clause in task body
    
    2020-06-05  Ed Schonberg  <schonberg@adacore.com>
    
    gcc/ada/
    
            * sem_ch9.adb, (Analyze_Task_Body): After analying the task
            body, indicate that all local variables have no delayed aspects.
            This prevents improper later calls to
            Check_Aspect_At_End_Of_Declarations, that would happen when the
            constructed task_procedure body (generated during expansion) is
            analyzed. The legality of aspect specifications that may appear
            on local declarations has already been established, and it is in
            general not possible to recheck them properly during expansion,
            when visibility may not be fully established.

Diff:
---
 gcc/ada/sem_ch9.adb | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb
index df438aca078..05a6d9aa1b5 100644
--- a/gcc/ada/sem_ch9.adb
+++ b/gcc/ada/sem_ch9.adb
@@ -2993,6 +2993,24 @@ package body Sem_Ch9 is
          else
             Set_First_Private_Entity (Spec_Id, First_Entity (Spec_Id));
          end if;
+
+         --  The entity list of the current scope now includes entities in
+         --  the spec as well as the body. Their declarations will become
+         --  part of the statement sequence of the task body procedure that
+         --  is built during expansion. Indicate that aspect specifications
+         --  for these entities need not be rechecked. The guards on
+         --  Check_Aspect_At_End_Of_Declarations are not sufficient to
+         --  suppress these checks, because the declarations come from source.
+
+         declare
+            Priv : Entity_Id := First_Private_Entity (Spec_Id);
+
+         begin
+            while Present (Priv) loop
+               Set_Has_Delayed_Aspects (Priv, False);
+               Next_Entity (Priv);
+            end loop;
+         end;
       end if;
 
       --  Mark all handlers as not suitable for local raise optimization,


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

only message in thread, other threads:[~2020-06-10  3:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10  3:40 [gcc(refs/users/guojiufu/heads/personal-branch)] [Ada] Spurious error on address clause in task body Jiu Fu Guo

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