//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11 // type_traits // is_final #include #include "test_macros.h" struct P final { }; union U1 { }; union U2 final { }; template void test_is_final() { static_assert( std::is_final::value, ""); static_assert( std::is_final::value, ""); static_assert( std::is_final::value, ""); static_assert( std::is_final::value, ""); #if TEST_STD_VER > 14 static_assert( std::is_final_v, ""); static_assert( std::is_final_v, ""); static_assert( std::is_final_v, ""); static_assert( std::is_final_v, ""); #endif } template void test_is_not_final() { static_assert(!std::is_final::value, ""); static_assert(!std::is_final::value, ""); static_assert(!std::is_final::value, ""); static_assert(!std::is_final::value, ""); #if TEST_STD_VER > 14 static_assert(!std::is_final_v, ""); static_assert(!std::is_final_v, ""); static_assert(!std::is_final_v, ""); static_assert(!std::is_final_v, ""); #endif } int main () { test_is_not_final(); test_is_not_final(); test_is_final

(); test_is_not_final(); test_is_not_final(); test_is_not_final(); test_is_final (); test_is_not_final(); }