Fix bugs in alignment_of_v, etc. Re-enable the newly added tests

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@254289 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2015-11-30 05:20:00 +00:00
parent c180f34dd3
commit ea972908a3
4 changed files with 19 additions and 19 deletions

View File

@@ -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

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}