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: Artemiy Volkov <artemiyv at acm dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Keith Seitz <keiths at redhat dot com>, gdb-patches at sourceware dot org
- Date: Wed, 6 Apr 2016 01:30:17 -0700
- 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>
On Tue, Apr 05, 2016 at 07:23:29PM +0100, Pedro Alves wrote:
> Thanks you very much for this patch set, and big thanks to Keith
> for the review.
>
> I read the series and it looks pretty good to me. The only
> thing I'm not sure about is the hardcoding of "-std=c++11"
> in tests. GCC 6 switches to -std=gnu++14 by default, for instance,
> and I wouldn't want the tests to not cover whatever the compiler
> uses by default. Note also that that's -std=gnu++14, not the stricter
> -std=c++14 mode. Could we make the testcases gracefully skip rvalue
> reference bits using #if __cplusplus?
Point about -std=gnu++ vs. -std=c++ taken, I'll fix it in v5.
My idea here was to use the earliest version of the C++ standard which
supports rvalue references and compile with that, since compiling with
every version after that should produce a functionally identical
program. So I'd say for every version of GCC capable of processing (GNU)
C++11+ code we should hardcode -std=gnu++11, based on the assumption
that the supplied version of the compiler is working correctly using any
standard. IOW I think we should be testing GDB, not GCC here.
That said, I think your approach has an advantage of letting the
testsuite pass when using an old compiler not supporting C++11. If we
should cater for those, then this consideration outweighs the ones in
the paragraph above. If not, then for the reasons given above, I think
we should leave -std=gnu++11 in place.
WDYT?
>
> BTW, please fix up all comments and commit logs to mention C++11
> instead of C++0x. :-)
Sure thing. Will fix in v5.
Thanks,
Artemiy