]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove redundant nested aggregates from diagnostics code
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 9 Jun 2025 14:09:35 +0000 (16:09 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 3 Jul 2025 08:16:25 +0000 (10:16 +0200)
A nested aggregate with a single "others => <>" clause is equivalent to a box
itself. Code cleanup; semantics is unaffected.

gcc/ada/ChangeLog:

* errid.ads (Diagnostic_Entries): Remove nested aggregate.
* errsw.adb (Switches): Likewise.

gcc/ada/errid.ads
gcc/ada/errsw.adb

index 21ef79c14017cae6cd019ff79339f63b33358b6b..56516d028bc1fe5b03f2e105b435a4448a4a2422 100644 (file)
@@ -77,7 +77,7 @@ package Errid is
    --    TODO: the mandatory fields for the documentation file could be changed
 
    Diagnostic_Entries : Diagnostics_Registry_Type :=
-     (No_Diagnostic_Id => (others => <>),
+     (No_Diagnostic_Id => <>,
       GNAT0001         =>
         (Status        => Active,
          Human_Id      => new String'("Default_Iterator_Not_Primitive_Error"),
index f4c4128fa3f221fa56f4375bd9c9ffd40c2acbf0..511e00d3b93e58dfae4454a92267ef01fbaaec63 100644 (file)
@@ -30,7 +30,7 @@ package body Errsw is
    Switches : constant array (Switch_Id)
      of Switch_Type :=
      (No_Switch_Id            =>
-        (others => <>),
+        <>,
       gnatwb                  =>
         (Human_Id          => new String'("Warn_On_Bad_Fixed_Value"),
          Status            => Active,