]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove superfluous statements
authorRonan Desplanques <desplanques@adacore.com>
Mon, 8 Sep 2025 07:57:17 +0000 (09:57 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 19 Sep 2025 09:26:10 +0000 (11:26 +0200)
This patch removes two occurrences of the following pattern:

    Analyze_Component_Declaration (N);
    Mutate_Ekind (Defining_Identifier (N), E_Component);

The second statement here has absolutely no effect, so its presence can
be confusing to the reader.

gcc/ada/ChangeLog:

* sem_ch3.adb (Add_Tag): Remove superfluous statements.

gcc/ada/sem_ch3.adb

index 293682eef39dd249dd7be3658d33dd6cd143043e..c261305f286d326571c9f9dac35d9a04f392484c 100644 (file)
@@ -1542,7 +1542,6 @@ package body Sem_Ch3 is
          Analyze_Component_Declaration (Decl);
 
          Set_Analyzed (Decl);
-         Mutate_Ekind            (Tag, E_Component);
          Set_Is_Tag              (Tag);
          Set_Is_Aliased          (Tag);
          Set_Is_Independent      (Tag);
@@ -1583,7 +1582,6 @@ package body Sem_Ch3 is
             Analyze_Component_Declaration (Decl);
 
             Set_Analyzed (Decl);
-            Mutate_Ekind            (Offset, E_Component);
             Set_Is_Aliased          (Offset);
             Set_Is_Independent      (Offset);
             Set_Related_Type        (Offset, Iface);