From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id F291A383D81B; Thu, 19 May 2022 14:08:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F291A383D81B 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-663] [Ada] Do not set Current_Error_Node to a node without location X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 795f74c735627f4215f18174e761c6b5b9098449 X-Git-Newrev: b64c4968c7f3eb4c5ac0c56e6f11b10419dacd0c Message-Id: <20220519140846.F291A383D81B@sourceware.org> Date: Thu, 19 May 2022 14:08:46 +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: Thu, 19 May 2022 14:08:47 -0000 https://gcc.gnu.org/g:b64c4968c7f3eb4c5ac0c56e6f11b10419dacd0c commit r13-663-gb64c4968c7f3eb4c5ac0c56e6f11b10419dacd0c Author: Eric Botcazou Date: Sat Feb 19 12:20:50 2022 +0100 [Ada] Do not set Current_Error_Node to a node without location The message "No source file position information available" is displayed in the bugbox when Current_Error_Node has no location, which is useless. gcc/ada/ * gcc-interface/trans.cc (gnat_to_gnu): Do not set Current_Error_Node to a node without location. Diff: --- gcc/ada/gcc-interface/trans.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index b8a0d5d5d30..4577d9f110b 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -6139,7 +6139,8 @@ gnat_to_gnu (Node_Id gnat_node) bool aa_sync; /* Save node number for error message and set location information. */ - Current_Error_Node = gnat_node; + if (Sloc (gnat_node) > No_Location) + Current_Error_Node = gnat_node; Sloc_to_locus (Sloc (gnat_node), &input_location); /* If we are only annotating types and this node is a statement, return