This is the mail archive of the
mailing list for the libstdc++ project.
Re: Failing test when run as C++11
- From: Daniel Krügler <daniel dot kruegler at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 9 May 2014 13:15:53 +0200
- Subject: Re: Failing test when run as C++11
- Authentication-results: sourceware.org; auth=none
- References: <20140509105321 dot GD10556 at redhat dot com>
2014-05-09 12:53 GMT+02:00 Jonathan Wakely <email@example.com>:
> 20_util/specialized_algorithms/uninitialized_copy/808590.cc fails if
> run in C++11 mode because is_nothrow_move_constructible<c> is false,
> which means vector::resize() copies the elements using non-const
> lvalue arguments, which selects the template constructor.
> (In C++03 it copies from *const* lvalue arguments, selecting the copy
> We can either fix it by adding throw() to the copy constructor, or by
> adding a move cosntructor (with a comment explaining why):
> #if __cplusplus >= 201103L
> c(c&&) = default;
> I can't decide which I prefer, does anyone else have a preference?
Do you know whether the test case was added to validate a bug fix and
if so, which one? I would like to ensure that the change still
reflects the original intention for adding it.