This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]