summaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h
diff options
context:
space:
mode:
authorAlexSm <[email protected]>2024-03-05 10:40:59 +0100
committerGitHub <[email protected]>2024-03-05 12:40:59 +0300
commit1ac13c847b5358faba44dbb638a828e24369467b (patch)
tree07672b4dd3604ad3dee540a02c6494cb7d10dc3d /contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h
parentffcca3e7f7958ddc6487b91d3df8c01054bd0638 (diff)
Library import 16 (#2433)
Co-authored-by: robot-piglet <[email protected]> Co-authored-by: deshevoy <[email protected]> Co-authored-by: robot-contrib <[email protected]> Co-authored-by: thegeorg <[email protected]> Co-authored-by: robot-ya-builder <[email protected]> Co-authored-by: svidyuk <[email protected]> Co-authored-by: shadchin <[email protected]> Co-authored-by: robot-ratatosk <[email protected]> Co-authored-by: innokentii <[email protected]> Co-authored-by: arkady-e1ppa <[email protected]> Co-authored-by: snermolaev <[email protected]> Co-authored-by: dimdim11 <[email protected]> Co-authored-by: kickbutt <[email protected]> Co-authored-by: abdullinsaid <[email protected]> Co-authored-by: korsunandrei <[email protected]> Co-authored-by: petrk <[email protected]> Co-authored-by: miroslav2 <[email protected]> Co-authored-by: serjflint <[email protected]> Co-authored-by: akhropov <[email protected]> Co-authored-by: prettyboy <[email protected]> Co-authored-by: ilikepugs <[email protected]> Co-authored-by: hiddenpath <[email protected]> Co-authored-by: mikhnenko <[email protected]> Co-authored-by: spreis <[email protected]> Co-authored-by: andreyshspb <[email protected]> Co-authored-by: dimaandreev <[email protected]> Co-authored-by: rashid <[email protected]> Co-authored-by: robot-ydb-importer <[email protected]> Co-authored-by: r-vetrov <[email protected]> Co-authored-by: ypodlesov <[email protected]> Co-authored-by: zaverden <[email protected]> Co-authored-by: vpozdyayev <[email protected]> Co-authored-by: robot-cozmo <[email protected]> Co-authored-by: v-korovin <[email protected]> Co-authored-by: arikon <[email protected]> Co-authored-by: khoden <[email protected]> Co-authored-by: psydmm <[email protected]> Co-authored-by: robot-javacom <[email protected]> Co-authored-by: dtorilov <[email protected]> Co-authored-by: sennikovmv <[email protected]> Co-authored-by: hcpp <[email protected]>
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h63
1 files changed, 25 insertions, 38 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h
index effe6998338..713cc357ee8 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/filesystem_error.h
@@ -14,11 +14,13 @@
#include <__config>
#include <__filesystem/path.h>
#include <__memory/shared_ptr.h>
+#include <__system_error/error_code.h>
+#include <__system_error/system_error.h>
#include <__utility/forward.h>
+#include <__verbose_abort>
#include <iosfwd>
#include <new>
-#include <system_error>
-#include <type_traits>
+#include <string>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -28,50 +30,38 @@
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-class _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error {
+class _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_EXPORTED_FROM_ABI filesystem_error : public system_error {
public:
- _LIBCPP_INLINE_VISIBILITY
- filesystem_error(const string& __what, error_code __ec)
- : system_error(__ec, __what),
- __storage_(make_shared<_Storage>(path(), path())) {
+ _LIBCPP_HIDE_FROM_ABI filesystem_error(const string& __what, error_code __ec)
+ : system_error(__ec, __what), __storage_(make_shared<_Storage>(path(), path())) {
__create_what(0);
}
- _LIBCPP_INLINE_VISIBILITY
- filesystem_error(const string& __what, const path& __p1, error_code __ec)
- : system_error(__ec, __what),
- __storage_(make_shared<_Storage>(__p1, path())) {
+ _LIBCPP_HIDE_FROM_ABI filesystem_error(const string& __what, const path& __p1, error_code __ec)
+ : system_error(__ec, __what), __storage_(make_shared<_Storage>(__p1, path())) {
__create_what(1);
}
- _LIBCPP_INLINE_VISIBILITY
- filesystem_error(const string& __what, const path& __p1, const path& __p2,
- error_code __ec)
- : system_error(__ec, __what),
- __storage_(make_shared<_Storage>(__p1, __p2)) {
+ _LIBCPP_HIDE_FROM_ABI filesystem_error(const string& __what, const path& __p1, const path& __p2, error_code __ec)
+ : system_error(__ec, __what), __storage_(make_shared<_Storage>(__p1, __p2)) {
__create_what(2);
}
- _LIBCPP_INLINE_VISIBILITY
- const path& path1() const noexcept { return __storage_->__p1_; }
+ _LIBCPP_HIDE_FROM_ABI const path& path1() const noexcept { return __storage_->__p1_; }
- _LIBCPP_INLINE_VISIBILITY
- const path& path2() const noexcept { return __storage_->__p2_; }
+ _LIBCPP_HIDE_FROM_ABI const path& path2() const noexcept { return __storage_->__p2_; }
- filesystem_error(const filesystem_error&) = default;
+ _LIBCPP_HIDE_FROM_ABI filesystem_error(const filesystem_error&) = default;
~filesystem_error() override; // key function
_LIBCPP_HIDE_FROM_ABI_VIRTUAL
- const char* what() const noexcept override {
- return __storage_->__what_.c_str();
- }
+ const char* what() const noexcept override { return __storage_->__what_.c_str(); }
void __create_what(int __num_paths);
private:
struct _LIBCPP_HIDDEN _Storage {
- _LIBCPP_INLINE_VISIBILITY
- _Storage(const path& __p1, const path& __p2) : __p1_(__p1), __p2_(__p2) {}
+ _LIBCPP_HIDE_FROM_ABI _Storage(const path& __p1, const path& __p2) : __p1_(__p1), __p2_(__p2) {}
path __p1_;
path __p2_;
@@ -80,22 +70,19 @@ private:
shared_ptr<_Storage> __storage_;
};
-// TODO(ldionne): We need to pop the pragma and push it again after
-// filesystem_error to work around PR41078.
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
+# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
template <class... _Args>
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_NO_EXCEPTIONS
-void __throw_filesystem_error(_Args&&... __args) {
+_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY void
+__throw_filesystem_error(_Args&&... __args) {
throw filesystem_error(_VSTD::forward<_Args>(__args)...);
}
-#else
-void __throw_filesystem_error(_Args&&...) {
- _VSTD::abort();
+# else
+template <class... _Args>
+_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY void
+__throw_filesystem_error(_Args&&...) {
+ _LIBCPP_VERBOSE_ABORT("filesystem_error was thrown in -fno-exceptions mode");
}
-#endif
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+# endif
_LIBCPP_END_NAMESPACE_FILESYSTEM