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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11
14 #include <type_traits>
15 #include "test_macros.h"
24 static_assert( std::is_final
<T
>::value
, "");
25 static_assert( std::is_final
<const T
>::value
, "");
26 static_assert( std::is_final
<volatile T
>::value
, "");
27 static_assert( std::is_final
<const volatile T
>::value
, "");
29 static_assert( std::is_final_v
<T
>, "");
30 static_assert( std::is_final_v
<const T
>, "");
31 static_assert( std::is_final_v
<volatile T
>, "");
32 static_assert( std::is_final_v
<const volatile T
>, "");
37 void test_is_not_final()
39 static_assert(!std::is_final
<T
>::value
, "");
40 static_assert(!std::is_final
<const T
>::value
, "");
41 static_assert(!std::is_final
<volatile T
>::value
, "");
42 static_assert(!std::is_final
<const volatile T
>::value
, "");
44 static_assert(!std::is_final_v
<T
>, "");
45 static_assert(!std::is_final_v
<const T
>, "");
46 static_assert(!std::is_final_v
<volatile T
>, "");
47 static_assert(!std::is_final_v
<const volatile T
>, "");
53 test_is_not_final
<int>();
54 test_is_not_final
<int*>();
56 test_is_not_final
<P
*>();
57 test_is_not_final
<U1
>();
58 test_is_not_final
<U1
*>();
60 test_is_not_final
<U2
*>();