From: Jonathan Wakely Date: Wed, 11 Dec 2019 13:45:56 +0000 (+0000) Subject: PR libstdc++/91786 fix compilation error with Clang X-Git-Tag: releases/gcc-9.3.0~325 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5765ed7aaa5486c6e8eefc569247f58eda355474;p=thirdparty%2Fgcc.git PR libstdc++/91786 fix compilation error with Clang Backport from mainline 2019-11-25 Jonathan Wakely PR libstdc++/91786 * include/bits/fs_path.h (filesystem_error): Move definition before the use in u8path. From-SVN: r279223 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 40a7116b8d9d..60f3e3496d35 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2019-12-11 Jonathan Wakely + + Backport from mainline + 2019-11-25 Jonathan Wakely + + PR libstdc++/91786 + * include/bits/fs_path.h (filesystem_error): Move definition before + the use in u8path. + 2019-12-10 Thomas Rodgers Backport from mainline diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h index e56a0a7f138a..5dc624dbb1eb 100644 --- a/libstdc++-v3/include/bits/fs_path.h +++ b/libstdc++-v3/include/bits/fs_path.h @@ -612,6 +612,36 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 size_t hash_value(const path& __p) noexcept; + /// Exception type thrown by the Filesystem library + class filesystem_error : public std::system_error + { + public: + filesystem_error(const string& __what_arg, error_code __ec); + + filesystem_error(const string& __what_arg, const path& __p1, + error_code __ec); + + filesystem_error(const string& __what_arg, const path& __p1, + const path& __p2, error_code __ec); + + filesystem_error(const filesystem_error&) = default; + filesystem_error& operator=(const filesystem_error&) = default; + + // No move constructor or assignment operator. + // Copy rvalues instead, so that _M_impl is not left empty. + + ~filesystem_error(); + + const path& path1() const noexcept; + const path& path2() const noexcept; + const char* what() const noexcept; + + private: + struct _Impl; + std::__shared_ptr _M_impl; + }; + + /// Create a path from a UTF-8-encoded sequence of char template inline auto u8path(_InputIterator __first, _InputIterator __last) @@ -642,6 +672,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 #endif } + /// Create a path from a UTF-8-encoded sequence of char template inline auto u8path(const _Source& __source) @@ -663,34 +694,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 #endif } - class filesystem_error : public std::system_error - { - public: - filesystem_error(const string& __what_arg, error_code __ec); - - filesystem_error(const string& __what_arg, const path& __p1, - error_code __ec); - - filesystem_error(const string& __what_arg, const path& __p1, - const path& __p2, error_code __ec); - - filesystem_error(const filesystem_error&) = default; - filesystem_error& operator=(const filesystem_error&) = default; - - // No move constructor or assignment operator. - // Copy rvalues instead, so that _M_impl is not left empty. - - ~filesystem_error(); - - const path& path1() const noexcept; - const path& path2() const noexcept; - const char* what() const noexcept; - - private: - struct _Impl; - std::__shared_ptr _M_impl; - }; - struct path::_Cmpt : path { _Cmpt(basic_string_view __s, _Type __t, size_t __pos)