This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v4 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb
- From: Pedro Alves <palves at redhat dot com>
- To: artemiyv at acm dot org
- Cc: Keith Seitz <keiths at redhat dot com>, "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Fri, 22 Apr 2016 12:31:50 +0100
- Subject: Re: [PATCH v4 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb
- Authentication-results: sourceware.org; auth=none
- References: <1457147955-21871-1-git-send-email-artemiyv at acm dot org> <1458593958-25656-1-git-send-email-artemiyv at acm dot org> <56FD89F7 dot 1020409 at redhat dot com> <20160402084706 dot GD7371 at gmail dot com> <570402A1 dot 6030600 at redhat dot com> <20160406083016 dot GA31849 at gmail dot com> <570CE0B6 dot 8080707 at redhat dot com> <CAOxjHa3qpmo3CE9f0qwNJd+C4DCvLjtY3pB0yVZaa=ktzvm7UA at mail dot gmail dot com>
On 04/19/2016 04:51 PM, Artemiy Volkov wrote:
> Actually, this pattern has already been introduced: see
> gdb.base/nested-subp[1-3].exp and gdb.cp/enum-class.exp. The authors of
> these tests hardcoded the standard version in the additional_flags
> variable. And I think this is the best way to go here -- IMO the cost of
> the implementation you suggested outweighs the benefits. I understand the
> idea of having the rvalue ref tests and the corresponding pointer/lvalue
> ref tests next to each other, but that would cause too much pollution by
> lots of "#ifdef __cplusplus >= ..." and reduced readability. And if we
> group the rvalue ref tests together to make it just one #ifdef, why don't
> we move those tests out to a separate file in the first place?
Alright, that's exactly the thought process that I was expecting.
> Also, using
> this scheme we would have to create a way to run only specific testcases
> twice, which doesn't look like a clean solution,
Note we do that in many places, by moving test code to procedures, and
then calling the procedure several times. gdb.linespec/ls-errs.exp
is one example that tries multiples languages.
> or maybe we'd have to run
> the whole gdb.cp/* part of testsuite twice which would be unwarranted
> waste of time. And people who want to run all of it using C++03 and C++11
> stds can do it by hand.
>
> So yeah, IMO the least of evils here would be to split rvalue reference
> tests to separate files and to hardcode -std=gnu++11 in the .exp files.
> This solution is much simpler, it keeps the source files clean, it assures
> that each testcase will be run once (which is not a bad thing regarding
> the time it takes to run the whole testsuite).
>
> What do you say? Am I missing something?
I say let's do this then.
Thanks,
Pedro Alves