[PATCH v4 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb
Pedro Alves
palves@redhat.com
Fri Apr 22 11:31:00 GMT 2016
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
More information about the Gdb-patches
mailing list