From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 9D8D0385740B; Tue, 17 May 2022 08:29:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D8D0385740B MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-541] [Ada] Fix insertion of declaration inside quantified expression X-Act-Checkin: gcc X-Git-Author: Yannick Moy X-Git-Refname: refs/heads/master X-Git-Oldrev: 5dbb65676f93504199c1200bfe4dc9f3bc72e2b2 X-Git-Newrev: 5c44da007b4a2fbf55d1ca86e456abf3789b50fd Message-Id: <20220517082909.9D8D0385740B@sourceware.org> Date: Tue, 17 May 2022 08:29:09 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2022 08:29:09 -0000 https://gcc.gnu.org/g:5c44da007b4a2fbf55d1ca86e456abf3789b50fd commit r13-541-g5c44da007b4a2fbf55d1ca86e456abf3789b50fd Author: Yannick Moy Date: Fri Mar 18 17:33:25 2022 +0100 [Ada] Fix insertion of declaration inside quantified expression When the evaluation of the subtype_indication for the iterator_specification of a quantified_expression leads to the insertion of a type declaration, this should be done with Insert_Action instead of Insert_Before. gcc/ada/ * sem_ch5.adb (Analyze_Iterator_Specification): Use Insert_Action when possibly inside an expression. Diff: --- gcc/ada/sem_ch5.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 633e5c7e543..e6d34c30c0b 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2316,7 +2316,7 @@ package body Sem_Ch5 is Defining_Identifier => S, Subtype_Indication => New_Copy_Tree (Subt)); begin - Insert_Before (Parent (Parent (N)), Decl); + Insert_Action (N, Decl); Analyze (Decl); Rewrite (Subt, New_Occurrence_Of (S, Sloc (Subt))); end;