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 r15-603] ada: Update docs for Resolve_Null_Array_Aggregate
Date: Fri, 17 May 2024 08:25:38 +0000 (GMT)	[thread overview]
Message-ID: <20240517082538.955D7384AB6F@sourceware.org> (raw)

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

commit r15-603-ga666066298f29bc08379aac75e65d1edb3eb415f
Author: Ronan Desplanques <desplanques@adacore.com>
Date:   Thu Mar 7 10:24:49 2024 +0100

    ada: Update docs for Resolve_Null_Array_Aggregate
    
    The documentation comments for Sem_Aggr.Resolve_Null_Array_Aggregate
    suggested that this subprogram created a subtype, which it didn't.
    This patch replaces those comments with ones that better match the
    behavior.
    
    gcc/ada/
    
            * sem_aggr.adb (Resolve_Null_Array_Aggregate): Update
            documentation comments.

Diff:
---
 gcc/ada/sem_aggr.adb | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 508c86bc5de7..64e7db79ecc9 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -409,11 +409,10 @@ package body Sem_Aggr is
    --  string as an aggregate, prior to resolution.
 
    function Resolve_Null_Array_Aggregate (N : Node_Id) return Boolean;
-   --  For the Ada 2022 construct, build a subtype with a null range for each
-   --  dimension, using the bounds from the context subtype (if the subtype
-   --  is constrained). If the subtype is unconstrained, then the bounds
-   --  are determined in much the same way as the bounds for a null string
-   --  literal with no applicable index constraint.
+   --  The recursive method used to construct an aggregate's bounds in
+   --  Resolve_Array_Aggregate cannot work for null array aggregates. This
+   --  function constructs an appropriate list of ranges and stores its first
+   --  element in Aggregate_Bounds (N).
 
    ---------------------------------
    --  Delta aggregate processing --
@@ -4540,7 +4539,8 @@ package body Sem_Aggr is
 
       Set_Parent (Constr, N);
 
-      --  Create a constrained subtype with null dimensions
+      --  Populate the list with null ranges. The relevant RM clauses are
+      --  RM 4.3.3 (26.1) and RM 4.3.3 (26).
 
       Index := First_Index (Typ);
       while Present (Index) loop

                 reply	other threads:[~2024-05-17  8:25 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=20240517082538.955D7384AB6F@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).