1505ceacdSEric Fiselier //===----------------------------------------------------------------------===//
2505ceacdSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6505ceacdSEric Fiselier //
7505ceacdSEric Fiselier //===----------------------------------------------------------------------===//
8505ceacdSEric Fiselier 
9505ceacdSEric Fiselier // type_traits
10505ceacdSEric Fiselier 
11505ceacdSEric Fiselier // bool_constant
12505ceacdSEric Fiselier 
13505ceacdSEric Fiselier #include <type_traits>
14505ceacdSEric Fiselier #include <cassert>
15505ceacdSEric Fiselier 
16505ceacdSEric Fiselier #include "test_macros.h"
17505ceacdSEric Fiselier 
main(int,char **)18*2df59c50SJF Bastien int main(int, char**)
19505ceacdSEric Fiselier {
20505ceacdSEric Fiselier #if TEST_STD_VER > 14
21505ceacdSEric Fiselier     typedef std::bool_constant<true> _t;
22505ceacdSEric Fiselier     static_assert(_t::value, "");
23505ceacdSEric Fiselier     static_assert((std::is_same<_t::value_type, bool>::value), "");
24505ceacdSEric Fiselier     static_assert((std::is_same<_t::type, _t>::value), "");
25505ceacdSEric Fiselier     static_assert((_t() == true), "");
26505ceacdSEric Fiselier 
27505ceacdSEric Fiselier     typedef std::bool_constant<false> _f;
28505ceacdSEric Fiselier     static_assert(!_f::value, "");
29505ceacdSEric Fiselier     static_assert((std::is_same<_f::value_type, bool>::value), "");
30505ceacdSEric Fiselier     static_assert((std::is_same<_f::type, _f>::value), "");
31505ceacdSEric Fiselier     static_assert((_f() == false), "");
32505ceacdSEric Fiselier #endif
33*2df59c50SJF Bastien 
34*2df59c50SJF Bastien   return 0;
35505ceacdSEric Fiselier }
36