Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:28

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___CXX03___FORMAT_FORMAT_ERROR_H
0011 #define _LIBCPP___CXX03___FORMAT_FORMAT_ERROR_H
0012 
0013 #include <__cxx03/__config>
0014 #include <__cxx03/__verbose_abort>
0015 #include <__cxx03/stdexcept>
0016 
0017 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0018 #  pragma GCC system_header
0019 #endif
0020 
0021 _LIBCPP_BEGIN_NAMESPACE_STD
0022 
0023 #if _LIBCPP_STD_VER >= 20
0024 
0025 _LIBCPP_DIAGNOSTIC_PUSH
0026 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
0027 class _LIBCPP_EXPORTED_FROM_ABI format_error : public runtime_error {
0028 public:
0029   _LIBCPP_HIDE_FROM_ABI explicit format_error(const string& __s) : runtime_error(__s) {}
0030   _LIBCPP_HIDE_FROM_ABI explicit format_error(const char* __s) : runtime_error(__s) {}
0031   _LIBCPP_HIDE_FROM_ABI format_error(const format_error&)            = default;
0032   _LIBCPP_HIDE_FROM_ABI format_error& operator=(const format_error&) = default;
0033   _LIBCPP_HIDE_FROM_ABI_VIRTUAL
0034   ~format_error() noexcept override = default;
0035 };
0036 _LIBCPP_DIAGNOSTIC_POP
0037 
0038 _LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void __throw_format_error(const char* __s) {
0039 #  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
0040   throw format_error(__s);
0041 #  else
0042   _LIBCPP_VERBOSE_ABORT("format_error was thrown in -fno-exceptions mode with message \"%s\"", __s);
0043 #  endif
0044 }
0045 
0046 #endif //_LIBCPP_STD_VER >= 20
0047 
0048 _LIBCPP_END_NAMESPACE_STD
0049 
0050 #endif // _LIBCPP___CXX03___FORMAT_FORMAT_ERROR_H