[PATCH] PR libstdc++/83306 make filesystem_error no-throw copyable
Jonathan Wakely
jwakely@redhat.com
Wed Nov 28 16:52:00 GMT 2018
On 28/11/18 15:27 +0000, Jonathan Wakely wrote:
>The class API provides no way to modify the members, so we can share
>them between copies of the same object. Copying becomes a simple
>reference count update, which doesn't throw.
>
>Also adjust the what() string to allow distinguishing between an empty
>path passed to the constructor, and no path.
>
> PR libstdc++/83306
> * include/bits/fs_path.h (filesystem_error): Move data members into
> pimpl class owned by shared_ptr. Remove inline definitions of member
> functions.
> * src/filesystem/std-path.cc (filesystem_error::_Impl): Define.
> (filesystem_error): Define member functions.
> * testsuite/27_io/filesystem/filesystem_error/cons.cc: New test.
> * testsuite/27_io/filesystem/filesystem_error/copy.cc: New test.
>
>Tested x86_64-linux, committed to trunk.
Ops, this broke he TS implementation:
FAIL: experimental/filesystem/operations/remove.cc (test for excess errors)
Excess errors:
/home/jwakely/src/gcc/libstdc++-v3/src/filesystem/path.cc:505: undefined reference to `std::filesystem::fs_err_concat(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Fix coming up ...
More information about the Libstdc++
mailing list