[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.
This commit is contained in:
Eric Botcazou 2022-02-19 12:20:50 +01:00 committed by Pierre-Marie de Rodat
parent 795f74c735
commit b64c4968c7

View File

@ -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