diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-11-25 19:01:58 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-11-25 19:01:58 +0000 |
commit | d6039f5ce1b2110d458ededa6f8fa230927af772 (patch) | |
tree | cdd2f19c1edb1cd91e14167806c3aebf748b067a | |
parent | d222e47058aa77bd2b4ab6341229f27a84f606f2 (diff) | |
download | gcc-d6039f5ce1b2110d458ededa6f8fa230927af772.zip gcc-d6039f5ce1b2110d458ededa6f8fa230927af772.tar.gz gcc-d6039f5ce1b2110d458ededa6f8fa230927af772.tar.bz2 |
PR libstdc++/91786 fix compilation error with Clang
PR libstdc++/91786
* include/bits/fs_path.h (filesystem_error): Move definition before
the use in u8path.
From-SVN: r278697
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/fs_path.h | 72 |
2 files changed, 45 insertions, 33 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a479a12..09202af 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2019-11-25 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/91786 + * include/bits/fs_path.h (filesystem_error): Move definition before + the use in u8path. + 2019-11-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/functions.h: Remove <bits/move.h> include. diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h index e1083ac..031ec3d 100644 --- a/libstdc++-v3/include/bits/fs_path.h +++ b/libstdc++-v3/include/bits/fs_path.h @@ -622,7 +622,41 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 size_t hash_value(const path& __p) noexcept; - /// Create a path from a UTF-8-encoded sequence of char + /// @} + + /// 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<const _Impl> _M_impl; + }; + + /** Create a path from a UTF-8-encoded sequence of char + * + * @relates std::filesystem::path + */ template<typename _InputIterator> inline auto u8path(_InputIterator __first, _InputIterator __last) @@ -653,7 +687,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 #endif } - /// Create a path from a UTF-8-encoded sequence of char + /** Create a path from a UTF-8-encoded sequence of char + * + * @relates std::filesystem::path + */ template<typename _Source> inline auto u8path(const _Source& __source) @@ -675,37 +712,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 #endif } - /// @} - - /// 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<const _Impl> _M_impl; - }; - /// @cond undocumented struct path::_Cmpt : path |