I've been sitting on this series for a while now as part of the whole
"eliminate cleanups" effort, and since other folks are looking at
eliminating cleanups too, I thought I'd get this one over with to
avoid duplication.
In one of the patches (and also in [1] and in another larger series
I'm working on) I kept wanting to use gdb::optional, but finding
"opt.emplace(....)" a bit cumbersome compared to the more natural
ctor/op=. So I bit the bullet and brought in a bit more of C++17's
std::optional API into gdb::optional.
I then tried to follow the "Unit tests or it didn't happen (TM)"
principle and added unit tests for gdb::optional. That payed off and
caught some bugs in the new code I was adding.
[1] - https://sourceware.org/ml/gdb-patches/2017-03/msg00497.html
Tested on x86-64 Fedora 23, native and gdbserver.