PR libstdc++/91012 fixfilesystem_error::what() string
commite11c48711128a8aff3938cf28954acf1b1cc0b62
authorJonathan Wakely <jwakely@redhat.com>
Thu, 27 Jun 2019 09:42:39 +0000 (27 10:42 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 27 Jun 2019 09:42:39 +0000 (27 10:42 +0100)
treea52f13388f07db6a0045d26e0e71e44bc6692057
parent4c4be718fb65f9b8dd06d83c6fa3f697a5369d52
PR libstdc++/91012 fixfilesystem_error::what() string

When I refactored the filesystem_error code I changed it to only use the
constructor parameter in the what() string, instead of the string
returned by system_error::what(). That meant it no longer included the
description of the error_code that system_error adds. This restores the
previous behaivour, as encouraged by the standard ("Implementations
should include the system_error::what() string and the pathnames of
path1 and path2 in the native format in the returned string").

PR libstdc++/91012
* src/c++17/fs_path.cc (filesystem_error::_Impl): Use a string_view
for the what_arg parameters.
(filesystem_error::filesystem_error): Pass system_error::what() to
the _Impl constructor.
* testsuite/27_io/filesystem/filesystem_error/cons.cc: Ensure that
filesystem_error::what() contains system_error::what().

From-SVN: r272739
libstdc++-v3/ChangeLog
libstdc++-v3/src/c++17/fs_path.cc
libstdc++-v3/testsuite/27_io/filesystem/filesystem_error/cons.cc