//===----------------------------------------------------------------------===// // // 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_reference #include #include // for std::nullptr_t #include "test_macros.h" template void test_is_reference() { static_assert( std::is_reference::value, ""); static_assert( std::is_reference::value, ""); static_assert( std::is_reference::value, ""); static_assert( std::is_reference::value, ""); #if TEST_STD_VER > 14 static_assert( std::is_reference_v, ""); static_assert( std::is_reference_v, ""); static_assert( std::is_reference_v, ""); static_assert( std::is_reference_v, ""); #endif } template void test_is_not_reference() { static_assert(!std::is_reference::value, ""); static_assert(!std::is_reference::value, ""); static_assert(!std::is_reference::value, ""); static_assert(!std::is_reference::value, ""); #if TEST_STD_VER > 14 static_assert(!std::is_reference_v, ""); static_assert(!std::is_reference_v, ""); static_assert(!std::is_reference_v, ""); static_assert(!std::is_reference_v, ""); #endif } class incomplete_type; class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; enum Enum {zero, one}; typedef void (*FunctionPtr)(); int main() { test_is_reference(); #if TEST_STD_VER >= 11 test_is_reference(); #endif test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); test_is_not_reference(); }