diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-02-19 12:20:50 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-19 14:05:33 +0000 |
commit | b64c4968c7f3eb4c5ac0c56e6f11b10419dacd0c (patch) | |
tree | e560bce8a1a790f2a73fc5330727c15945ed9914 /gcc/ada/gcc-interface/trans.cc | |
parent | 795f74c735627f4215f18174e761c6b5b9098449 (diff) | |
download | gcc-b64c4968c7f3eb4c5ac0c56e6f11b10419dacd0c.zip gcc-b64c4968c7f3eb4c5ac0c56e6f11b10419dacd0c.tar.gz gcc-b64c4968c7f3eb4c5ac0c56e6f11b10419dacd0c.tar.bz2 |
[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.
Diffstat (limited to 'gcc/ada/gcc-interface/trans.cc')
-rw-r--r-- | gcc/ada/gcc-interface/trans.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index b8a0d5d..4577d9f 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 |