forked from OSchip/llvm-project
Fix bugs in alignment_of_v, etc. Re-enable the newly added tests
llvm-svn: 254289
This commit is contained in:
parent
00b6b01592
commit
12dff9e66a
|
@ -1080,7 +1080,7 @@ template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY rank<_Tp[_Np]>
|
|||
: public integral_constant<size_t, rank<_Tp>::value + 1> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
|
||||
template <class _Tp> _LIBCPP_CONSTEXPR bool rank_v
|
||||
template <class _Tp> _LIBCPP_CONSTEXPR size_t rank_v
|
||||
= rank<_Tp>::value;
|
||||
#endif
|
||||
|
||||
|
@ -1098,7 +1098,7 @@ template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TYPE_VIS_ONLY exte
|
|||
: public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
|
||||
template <class _Tp, unsigned _Ip = 0> _LIBCPP_CONSTEXPR bool extent_v
|
||||
template <class _Tp, unsigned _Ip = 0> _LIBCPP_CONSTEXPR size_t extent_v
|
||||
= extent<_Tp, _Ip>::value;
|
||||
#endif
|
||||
|
||||
|
@ -1451,7 +1451,7 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY alignment_of
|
|||
: public integral_constant<size_t, __alignof__(_Tp)> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
|
||||
template <class _Tp> _LIBCPP_CONSTEXPR bool alignment_of_v
|
||||
template <class _Tp> _LIBCPP_CONSTEXPR size_t alignment_of_v
|
||||
= alignment_of<_Tp>::value;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -24,10 +24,10 @@ void test_alignment_of()
|
|||
static_assert( std::alignment_of<volatile T>::value == A, "");
|
||||
static_assert( std::alignment_of<const volatile T>::value == A, "");
|
||||
#if TEST_STD_VER > 14
|
||||
// static_assert( std::alignment_of_v<T> == A, "");
|
||||
// static_assert( std::alignment_of_v<const T> == A, "");
|
||||
// static_assert( std::alignment_of_v<volatile T> == A, "");
|
||||
// static_assert( std::alignment_of_v<const volatile T> == A, "");
|
||||
static_assert( std::alignment_of_v<T> == A, "");
|
||||
static_assert( std::alignment_of_v<const T> == A, "");
|
||||
static_assert( std::alignment_of_v<volatile T> == A, "");
|
||||
static_assert( std::alignment_of_v<const volatile T> == A, "");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -23,10 +23,10 @@ void test_extent()
|
|||
static_assert((std::extent<volatile T>::value == A), "");
|
||||
static_assert((std::extent<const volatile T>::value == A), "");
|
||||
#if TEST_STD_VER > 14
|
||||
// static_assert((std::extent_v<T> == A), "");
|
||||
// static_assert((std::extent_v<const T> == A), "");
|
||||
// static_assert((std::extent_v<volatile T> == A), "");
|
||||
// static_assert((std::extent_v<const volatile T> == A), "");
|
||||
static_assert((std::extent_v<T> == A), "");
|
||||
static_assert((std::extent_v<const T> == A), "");
|
||||
static_assert((std::extent_v<volatile T> == A), "");
|
||||
static_assert((std::extent_v<const volatile T> == A), "");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -38,10 +38,10 @@ void test_extent1()
|
|||
static_assert((std::extent<volatile T, 1>::value == A), "");
|
||||
static_assert((std::extent<const volatile T, 1>::value == A), "");
|
||||
#if TEST_STD_VER > 14
|
||||
// static_assert((std::extent_v<T, 1> == A), "");
|
||||
// static_assert((std::extent_v<const T, 1> == A), "");
|
||||
// static_assert((std::extent_v<volatile T, 1> == A), "");
|
||||
// static_assert((std::extent_v<const volatile T, 1> == A), "");
|
||||
static_assert((std::extent_v<T, 1> == A), "");
|
||||
static_assert((std::extent_v<const T, 1> == A), "");
|
||||
static_assert((std::extent_v<volatile T, 1> == A), "");
|
||||
static_assert((std::extent_v<const volatile T, 1> == A), "");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -23,10 +23,10 @@ void test_rank()
|
|||
static_assert( std::rank<volatile T>::value == A, "");
|
||||
static_assert( std::rank<const volatile T>::value == A, "");
|
||||
#if TEST_STD_VER > 14
|
||||
// static_assert( std::rank_v<T> == A, "");
|
||||
// static_assert( std::rank_v<const T> == A, "");
|
||||
// static_assert( std::rank_v<volatile T> == A, "");
|
||||
// static_assert( std::rank_v<const volatile T> == A, "");
|
||||
static_assert( std::rank_v<T> == A, "");
|
||||
static_assert( std::rank_v<const T> == A, "");
|
||||
static_assert( std::rank_v<volatile T> == A, "");
|
||||
static_assert( std::rank_v<const volatile T> == A, "");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue