chromium/third_party/libc++/src/include/__filesystem/filesystem_error.h

// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H
#define _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H

#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 <string>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#  pragma GCC system_header
#endif

#if _LIBCPP_STD_VER >= 17

_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM

class _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_EXPORTED_FROM_ABI filesystem_error : public system_error {};

#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
template <class... _Args>
_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY void
__throw_filesystem_error(_Args&&... __args) {
  throw filesystem_error(std::forward<_Args>(__args)...);
}
#  else
template <class... _Args>
_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY void
__throw_filesystem_error(_Args&&...) {}
#  endif

_LIBCPP_END_NAMESPACE_FILESYSTEM

#endif // _LIBCPP_STD_VER >= 17

#endif // _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H