1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 // template <> struct is_error_code_enum<> : public false_type {};
17 #include <system_error>
19 #include "test_macros.h"
21 template <bool Expected
, class T
>
25 static_assert((std::is_error_code_enum
<T
>::value
== Expected
), "");
27 static_assert((std::is_error_code_enum_v
<T
> == Expected
), "");
28 ASSERT_SAME_TYPE(decltype(std::is_error_code_enum_v
<T
>), const bool);
34 operator std::error_code () const { return std::error_code(); }
37 // Specialize the template for my class
39 struct std::is_error_code_enum
<A
> : public std::true_type
{};
45 test
<false, std::nullptr_t
>();
46 test
<false, std::string
>();