[Bug libstdc++/94242] filesystem::path::generic_string() only works with std::allocator
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Mar 21 22:05:21 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94242
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:9fc985118d9f5014afc1caf32a411ee5803fba61
commit r10-7317-g9fc985118d9f5014afc1caf32a411ee5803fba61
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Sat Mar 21 21:51:07 2020 +0000
libstdc++: Fix path::generic_string allocator handling (PR 94242)
It's not possible to construct a path::string_type from an allocator of
a different type. Create the correct specialization of basic_string, and
adjust path::_S_str_convert to use a basic_string_view so that it is
independent of the allocator type.
PR libstdc++/94242
* include/bits/fs_path.h (path::_S_str_convert): Replace first
parameter with basic_string_view so that strings with different
allocators can be accepted.
(path::generic_string<C,T,A>()): Use basic_string object that uses
the
right allocator type.
* testsuite/27_io/filesystem/path/generic/94242.cc: New test.
* testsuite/27_io/filesystem/path/generic/generic_string.cc:
Improve
test coverage.
More information about the Gcc-bugs
mailing list