[Bug libstdc++/94242] New: filesystem::path::generic_string() only works with std::allocator
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 20 21:09:54 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94242
Bug ID: 94242
Summary: filesystem::path::generic_string() only works with
std::allocator
Product: gcc
Version: 9.3.1
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
#include <filesystem>
template<typename T>
struct A
{
using value_type = T;
T* allocate(std::size_t n) { return std::allocator<T>().allocate(n); }
void deallocate(T* p, std::size_t n) { std::allocator<T>().deallocate(p, n);
}
};
std::filesystem::path p;
std::basic_string<char, std::char_traits<char>, A<char>> s
= p.generic_string<char, std::char_traits<char>, A<char>>();
Compiled with -std=gnu++17:
In file included from /home/jwakely/gcc/10/include/c++/10.0.1/filesystem:45,
from gen.cc:1:
/home/jwakely/gcc/10/include/c++/10.0.1/bits/fs_path.h: In instantiation of
'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>
std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with
_CharT = char; _Traits = std::char_traits<char>; _Allocator = A<char>]':
gen.cc:14:61: required from here
/home/jwakely/gcc/10/include/c++/10.0.1/bits/fs_path.h:1129:19: error: no
matching function for call to
'std::__cxx11::basic_string<char>::basic_string(const A<char>&)'
1129 | string_type __str(__a);
| ^~~~~
More information about the Gcc-bugs
mailing list