This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/7] C++fy xml-support.c and more gdb::optional
On 04/15/2017 05:20 PM, Simon Marchi wrote:
> On 2017-04-10 08:22, Pedro Alves wrote:
>> 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.
>
> I looked at the series at a high level, it looks good. I don't mind
> about the tests, they can only be helpful.
Thanks, I've pushed it in now.
> I am actually happy about the change to optional, because I recently
> tried to do a function that returned an optional and found out it wasn't
> possible yet.
Oh, that's right. I should have mentioned that in the commit log.
I've done that now. I'll reply to that patch with with I pushed.
Thanks,
Pedro Alves