//===----------------------------------------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// // #include #include #include #include "test_macros.h" #ifndef NULL #error NULL not defined #endif #ifndef offsetof #error offsetof not defined #endif int main() { void *p = NULL; assert(!p); static_assert(sizeof(size_t) == sizeof(void*), "sizeof(size_t) == sizeof(void*)"); static_assert(std::is_unsigned::value, "std::is_unsigned::value"); static_assert(std::is_integral::value, "std::is_integral::value"); static_assert(sizeof(ptrdiff_t) == sizeof(void*), "sizeof(ptrdiff_t) == sizeof(void*)"); static_assert(std::is_signed::value, "std::is_signed::value"); static_assert(std::is_integral::value, "std::is_integral::value"); static_assert((std::is_same::value), "decltype(nullptr) == nullptr_t"); static_assert(sizeof(nullptr_t) == sizeof(void*), "sizeof(nullptr_t) == sizeof(void*)"); #if TEST_STD_VER > 17 // P0767 static_assert(std::is_trivial::value, "std::is_trivial::value"); static_assert(std::is_standard_layout::value, "std::is_standard_layout::value"); #else static_assert(std::is_pod::value, "std::is_pod::value"); #endif static_assert((std::alignment_of::value >= std::alignment_of::value), "std::alignment_of::value >= " "std::alignment_of::value"); static_assert(std::alignment_of::value >= std::alignment_of::value, "std::alignment_of::value >= " "std::alignment_of::value"); static_assert(std::alignment_of::value >= std::alignment_of::value, "std::alignment_of::value >= " "std::alignment_of::value"); }