//===----------------------------------------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// // type_traits // is_unsigned #include #include "test_macros.h" template void test_is_unsigned() { static_assert( std::is_unsigned::value, ""); static_assert( std::is_unsigned::value, ""); static_assert( std::is_unsigned::value, ""); static_assert( std::is_unsigned::value, ""); #if TEST_STD_VER > 14 static_assert( std::is_unsigned_v, ""); static_assert( std::is_unsigned_v, ""); static_assert( std::is_unsigned_v, ""); static_assert( std::is_unsigned_v, ""); #endif } template void test_is_not_unsigned() { static_assert(!std::is_unsigned::value, ""); static_assert(!std::is_unsigned::value, ""); static_assert(!std::is_unsigned::value, ""); static_assert(!std::is_unsigned::value, ""); #if TEST_STD_VER > 14 static_assert(!std::is_unsigned_v, ""); static_assert(!std::is_unsigned_v, ""); static_assert(!std::is_unsigned_v, ""); static_assert(!std::is_unsigned_v, ""); #endif } class Class { public: ~Class(); }; struct A; // incomplete int main() { test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_not_unsigned(); test_is_unsigned(); test_is_unsigned(); #ifndef _LIBCPP_HAS_NO_INT128 test_is_unsigned<__uint128_t>(); test_is_not_unsigned<__int128_t>(); #endif }