]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Update docs for Resolve_Null_Array_Aggregate
authorRonan Desplanques <desplanques@adacore.com>
Thu, 7 Mar 2024 09:24:49 +0000 (10:24 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 17 May 2024 08:21:02 +0000 (10:21 +0200)
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.

gcc/ada/sem_aggr.adb

index 508c86bc5de7615ea2476b540011be1495dc1196..64e7db79ecc935b23805718a4fe98aed602ebad4 100644 (file)
@@ -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