// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -std=c++11 -verify %s // expected-no-diagnostics struct true_type { static constexpr const bool value = true; }; struct false_type { static constexpr const bool value = false; }; template struct is_same : public false_type {}; template struct is_same<_Tp, _Tp> : public true_type {}; // Check that our 'is_same' works. static_assert(is_same::value, "is_same is broken"); static_assert(!is_same::value, "is_same is broken"); template struct check_type { static constexpr const bool value = (alignof(_Tp) == _AlignOf) && (sizeof(_Tp) == _SizeOf); }; //===----------------------------------------------------------------------===// // Fundamental types //===----------------------------------------------------------------------===// static_assert(check_type::value, "bool is wrong"); static_assert(check_type::value, "char is wrong"); static_assert(check_type::value, "signed char is wrong"); static_assert(check_type::value, "unsigned char is wrong"); static_assert(check_type::value, "char16_t is wrong"); static_assert(check_type::value, "char32_t is wrong"); static_assert(check_type::value, "wchar_t is wrong"); static_assert(check_type::value, "short is wrong"); static_assert(check_type::value, "unsigned short is wrong"); static_assert(check_type::value, "int is wrong"); static_assert(check_type::value, "unsigned int is wrong"); static_assert(check_type::value, "long is wrong"); static_assert(check_type::value, "unsigned long is wrong"); static_assert(check_type::value, "long long is wrong"); static_assert(check_type::value, "unsigned long long is wrong"); static_assert(check_type::value, "float is wrong"); static_assert(check_type::value, "double is wrong"); static_assert(check_type::value, "long double is wrong"); static_assert(check_type::value, "'void *' is wrong"); static_assert(check_type::value, "function pointer is wrong"); //===----------------------------------------------------------------------===// // stdarg.h //===----------------------------------------------------------------------===// #include static_assert(check_type::value, "va_list is wrong"); //===----------------------------------------------------------------------===// // stddef.h //===----------------------------------------------------------------------===// #define __STDC_WANT_LIB_EXT1__ 1 #include static_assert(is_same::value, "::ptrdiff_t is wrong"); static_assert(is_same::value, "::size_t is wrong"); static_assert(is_same::value, "::size_t is wrong"); static_assert(is_same::value, "::rsize_t is wrong"); static_assert(is_same::value, "::max_align_t is wrong"); #define __need_wint_t #include static_assert(is_same::value, "::wint_t is wrong");