[Bug libstdc++/83306] filesystem_error is not nothrow copyable
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 28 15:27:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83306
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Wed Nov 28 15:27:11 2018
New Revision: 266565
URL: https://gcc.gnu.org/viewcvs?rev=266565&root=gcc&view=rev
Log:
PR libstdc++/83306 make filesystem_error no-throw copyable
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.
Added:
trunk/libstdc++-v3/testsuite/27_io/filesystem/filesystem_error/
trunk/libstdc++-v3/testsuite/27_io/filesystem/filesystem_error/cons.cc
trunk/libstdc++-v3/testsuite/27_io/filesystem/filesystem_error/copy.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/fs_path.h
trunk/libstdc++-v3/src/filesystem/std-path.cc
More information about the Gcc-bugs
mailing list