]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Correct xref of operator expression function body
authorBob Duff <duff@adacore.com>
Thu, 12 Dec 2024 14:13:16 +0000 (09:13 -0500)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 6 Jan 2025 09:14:48 +0000 (10:14 +0100)
commite3a67dcc1ab950176a62f3cebd61938332d31887
treec4322ca66715b675ece8c0cdf45eb3b95253a58c
parente4ed78faa3eb0f6b9b28d4491c22e5edb39339bf
ada: Correct xref of operator expression function body

For an expression function body that is an operator,
make sure the xref entry in the ALI file points one past the
double quote mark. For example, if the name is ">", point
to the greater-than symbol, not the double quote.
This was already the case for proper bodies.

gcc/ada/ChangeLog:

* sem_util.adb (Copy_Subprogram_Spec): When copying
an N_Defining_Operator_Symbol, create an
N_Defining_Operator_Symbol rather than an N_Defining_Identifier.
This will cause Lib.Xref to "skip the initial quote for
navigation purposes" (as per comments in Lib.Xref body).
gcc/ada/sem_util.adb