]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ada-lang.c
Implement Ada operator overloading
authorTom Tromey <tromey@adacore.com>
Mon, 15 Mar 2021 12:23:12 +0000 (06:23 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 15 Mar 2021 12:23:13 +0000 (06:23 -0600)
commitc04da66c264162e6efc37686c0e4ee46c5b048ab
treef87389e0dfdedf5f5a918742261d11ae29babcf3
parent9863c3b5fc64eec400ed55792a49c678927a6145
Implement Ada operator overloading

In the expression rewrite, I neglected to carry over support for Ada
operator overloading.  It turns out that there were no tests for this
in-tree.

This patch adds support for operator overloading, and adds the missing
test.

gdb/ChangeLog
2021-03-15  Tom Tromey  <tromey@adacore.com>

* ada-lang.c (numeric_type_p, integer_type_p): Return true for
fixed-point.
* ada-exp.y (maybe_overload): New function.
(ada_wrap_overload): New function.
(ada_un_wrap2, ada_wrap2, ada_wrap_op): Use maybe_overload.
(exp1, simple_exp, relation, and_exp, and_then_exp, or_exp)
(or_else_exp, xor_exp, primary): Update.

gdb/testsuite/ChangeLog
2021-03-15  Tom Tromey  <tromey@adacore.com>

* gdb.ada/operator_call/twovecs.ads: New file.
* gdb.ada/operator_call/twovecs.adb: New file.
* gdb.ada/operator_call/opcall.adb: New file.
* gdb.ada/operator_call.exp: New file.
gdb/ChangeLog
gdb/ada-exp.y
gdb/ada-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/operator_call.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/operator_call/opcall.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/operator_call/twovecs.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/operator_call/twovecs.ads [new file with mode: 0644]