[Bug libstdc++/91012] filesystem_error no longer includes error_code message

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 27 10:06:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91012

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Thu Jun 27 10:06:09 2019
New Revision: 272741

URL: https://gcc.gnu.org/viewcvs?rev=272741&root=gcc&view=rev
Log:
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().

Modified:
    branches/gcc-9-branch/libstdc++-v3/ChangeLog
    branches/gcc-9-branch/libstdc++-v3/src/c++17/fs_path.cc
   
branches/gcc-9-branch/libstdc++-v3/testsuite/27_io/filesystem/filesystem_error/cons.cc


More information about the Gcc-bugs mailing list