Add support for __VA_OPT__
authorTom Tromey <tom@tromey.com>
Mon, 18 Sep 2017 02:36:41 +0000 (20:36 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 27 Sep 2017 13:51:33 +0000 (07:51 -0600)
commita9bbfbd85fddfea2db30810c33c4bb130a2ef773
treee8e03252fbd330c15075d6d2a45520985e88c65f
parent19485196044b2521af979f1e5c4a89bfb90fba0b
Add support for __VA_OPT__

C++2a adds a "__VA_OPT__" feature that can be used to control the
pesky "," emission when the final (variable) argument of a variadic
macro is empty.  This patch implements this feature for gdb.  (A patch
to implement it for gcc is pending.)

gdb/ChangeLog
2017-09-27  Tom Tromey  <tom@tromey.com>

* macroexp.c (get_next_token_for_substitution): New function.
(substitute_args): Call it.  Check for __VA_OPT__.

gdb/testsuite/ChangeLog
2017-09-27  Tom Tromey  <tom@tromey.com>

* gdb.base/macscp.exp: Add __VA_OPT__ tests.
gdb/ChangeLog
gdb/macroexp.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/macscp.exp