Bug 53221 - [C++11] basic_string lacks "copy/move constructors" with allocator
Summary: [C++11] basic_string lacks "copy/move constructors" with allocator
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 5.0
Assignee: Jonathan Wakely
: 59283 (view as bug list)
Depends on:
Blocks: 24882
  Show dependency treegraph
Reported: 2012-05-03 20:13 UTC by Daniel Krügler
Modified: 2014-12-22 14:06 UTC (History)
1 user (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2012-05-03 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Krügler 2012-05-03 20:13:09 UTC
The library implementation of gcc 4.8.0 20120429 (experimental) misses the following "copy/move constructors" with allocators:

basic_string(const basic_string&, const Allocator&);
basic_string(basic_string&&, const Allocator&);

These were added to the working draft with acceptance of the allocator proposal


The following test case fails:

#include <string>
#include <memory>

int main()
  std::string s1;
  std::string s2(s1, std::allocator<char>());
  std::string s3(static_cast<std::string&&>(s1), std::allocator<char>());
Comment 1 Jonathan Wakely 2012-05-03 20:41:48 UTC
Yep, known issue - only vector has been updated to the C++11 allocator changes.
I've started doing it for vstring first, std::string will get done at some point too.

I thought the C++11 status table in the manual listed this as missing, but it doesn't (except under the general container requirements)
Comment 2 Jakub Jelinek 2013-03-22 14:44:06 UTC
GCC 4.8.0 is being released, adjusting target milestone.
Comment 3 Jonathan Wakely 2014-01-29 15:42:28 UTC
This will be done during stage 1 for the next release
Comment 4 Jonathan Wakely 2014-01-29 15:42:49 UTC
*** Bug 59283 has been marked as a duplicate of this bug. ***
Comment 5 Jonathan Wakely 2014-12-22 14:06:34 UTC
Fixed for GCC 5 (when using the new string ABI)