public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Marc Poulhi?s <dkm@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-4011] ada: Fix error on SPARK_Mode on library-level separate body
Date: Mon, 14 Nov 2022 13:51:33 +0000 (GMT)	[thread overview]
Message-ID: <20221114135133.97C103857BB2@sourceware.org> (raw)

https://gcc.gnu.org/g:442886a99dae94012575bcc1cd3407284da42081

commit r13-4011-g442886a99dae94012575bcc1cd3407284da42081
Author: Yannick Moy <moy@adacore.com>
Date:   Mon Oct 31 11:33:12 2022 +0100

    ada: Fix error on SPARK_Mode on library-level separate body
    
    When applying explicitly SPARK_Mode on a separate library-level spec
    and body for which a contract needs to be checked, compilation with
    -gnata was failing on a spurious error related to SPARK_Mode
    placement. Now fixed.
    
    gcc/ada/
    
            * sem_prag.adb (Analyze_Pragma): Add special case for the special
            local subprogram created for contracts.

Diff:
---
 gcc/ada/sem_prag.adb | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 615c6d2110c..77fcb1c505f 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -23424,10 +23424,14 @@ package body Sem_Prag is
                Spec_Id : constant Entity_Id := Unique_Defining_Entity (Decl);
 
             begin
-               --  Ignore pragma when applied to the special body created for
-               --  inlining, recognized by its internal name _Parent.
+               --  Ignore pragma when applied to the special body created
+               --  for inlining, recognized by its internal name _Parent; or
+               --  when applied to the special body created for contracts,
+               --  recognized by its internal name _Wrapped_Statements.
 
-               if Chars (Body_Id) = Name_uParent then
+               if Chars (Body_Id) in Name_uParent
+                                   | Name_uWrapped_Statements
+               then
                   return;
                end if;

                 reply	other threads:[~2022-11-14 13:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221114135133.97C103857BB2@sourceware.org \
    --to=dkm@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).