Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.help / bool_constant.pass.cpp
blob917f8b919fa988f6dba32f1ade05e2873fc22696
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 // type_traits
11 // bool_constant
13 #include <type_traits>
14 #include <cassert>
16 #include "test_macros.h"
18 int main(int, char**)
20 #if TEST_STD_VER > 14
21 typedef std::bool_constant<true> _t;
22 static_assert(_t::value, "");
23 static_assert((std::is_same<_t::value_type, bool>::value), "");
24 static_assert((std::is_same<_t::type, _t>::value), "");
25 static_assert((_t() == true), "");
27 typedef std::bool_constant<false> _f;
28 static_assert(!_f::value, "");
29 static_assert((std::is_same<_f::value_type, bool>::value), "");
30 static_assert((std::is_same<_f::type, _f>::value), "");
31 static_assert((_f() == false), "");
32 #endif
34 return 0;