Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.logical / negation.pass.cpp
blob5b3f2fade324f6833d4e48b81d7ace54eea0703e
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 // UNSUPPORTED: c++03, c++11, c++14
10 // type_traits
12 // template<class B> struct negation; // C++17
13 // template<class B>
14 // constexpr bool negation_v = negation<B>::value; // C++17
16 #include <type_traits>
17 #include <cassert>
19 #include "test_macros.h"
21 struct True { static constexpr bool value = true; };
22 struct False { static constexpr bool value = false; };
24 int main(int, char**)
26 static_assert (!std::negation<std::true_type >::value, "" );
27 static_assert ( std::negation<std::false_type>::value, "" );
29 static_assert (!std::negation_v<std::true_type >, "" );
30 static_assert ( std::negation_v<std::false_type>, "" );
32 static_assert (!std::negation<True >::value, "" );
33 static_assert ( std::negation<False>::value, "" );
35 static_assert (!std::negation_v<True >, "" );
36 static_assert ( std::negation_v<False>, "" );
38 static_assert ( std::negation<std::negation<std::true_type >>::value, "" );
39 static_assert (!std::negation<std::negation<std::false_type>>::value, "" );
41 return 0;