Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / src / error_category.cpp
blob8ae460fb5f1f4f286286b32f597fcd4b82131172
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include <__config>
11 #ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
12 # define _LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS
13 #endif
15 #include <system_error>
17 _LIBCPP_BEGIN_NAMESPACE_STD
19 // class error_category
21 #if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS)
22 error_category::error_category() noexcept {}
23 #endif
25 error_category::~error_category() noexcept {}
27 error_condition error_category::default_error_condition(int ev) const noexcept { return error_condition(ev, *this); }
29 bool error_category::equivalent(int code, const error_condition& condition) const noexcept {
30 return default_error_condition(code) == condition;
33 bool error_category::equivalent(const error_code& code, int condition) const noexcept {
34 return *this == code.category() && code.value() == condition;
37 _LIBCPP_END_NAMESPACE_STD