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 #include <type_traits>
16 #include "test_macros.h"
20 typedef std::integral_constant
<int, 5> _5
;
21 static_assert(_5::value
== 5, "");
22 static_assert((std::is_same
<_5::value_type
, int>::value
), "");
23 static_assert((std::is_same
<_5::type
, _5
>::value
), "");
24 #if TEST_STD_VER >= 11
25 static_assert((_5() == 5), "");
31 static_assert ( _5
{}() == 5, "" );
32 static_assert ( std::true_type
{}(), "" );
35 static_assert(std::false_type::value
== false, "");
36 static_assert((std::is_same
<std::false_type::value_type
, bool>::value
), "");
37 static_assert((std::is_same
<std::false_type::type
, std::false_type
>::value
), "");
39 static_assert(std::true_type::value
== true, "");
40 static_assert((std::is_same
<std::true_type::value_type
, bool>::value
), "");
41 static_assert((std::is_same
<std::true_type::type
, std::true_type
>::value
), "");
44 std::false_type f2
= f1
;
48 std::true_type t2
= t1
;