]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix missing warning on aggregate with iterated component
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 30 Jan 2023 12:05:09 +0000 (13:05 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 16 May 2023 08:30:59 +0000 (10:30 +0200)
This happens when the iterated component does not really iterate.

gcc/ada/

* exp_aggr.adb (Expand_Array_Aggregate): Do not set Warnings_Off on
the temporary created when in-place expansion is not possible.

gcc/ada/exp_aggr.adb

index cf8bac0f4bf401f8b0a17be94719f7e1240e3119..fe61e0ec90bf47ccad28d5661d3f6d881e43efff 100644 (file)
@@ -7068,7 +7068,6 @@ package body Exp_Aggr is
              Defining_Identifier => Tmp,
              Object_Definition   => New_Occurrence_Of (Typ, Loc));
          Set_No_Initialization (Tmp_Decl, True);
-         Set_Warnings_Off (Tmp);
 
          --  If we are within a loop, the temporary will be pushed on the
          --  stack at each iteration. If the aggregate is the expression