[libcxx] r254289 - Fix bugs in alignment_of_v, etc. Re-enable the newly added tests
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 29 21:20:00 PST 2015
Author: marshall
Date: Sun Nov 29 23:20:00 2015
New Revision: 254289
URL: http://llvm.org/viewvc/llvm-project?rev=254289&view=rev
Log:
Fix bugs in alignment_of_v, etc. Re-enable the newly added tests
Modified:
libcxx/trunk/include/type_traits
libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp
libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp
Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=254289&r1=254288&r2=254289&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Sun Nov 29 23:20:00 2015
@@ -1080,7 +1080,7 @@ template <class _Tp, size_t _Np> struct
: 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, unsigne
: 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
: 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
Modified: libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp?rev=254289&r1=254288&r2=254289&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp Sun Nov 29 23:20:00 2015
@@ -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
}
Modified: libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp?rev=254289&r1=254288&r2=254289&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp Sun Nov 29 23:20:00 2015
@@ -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
}
Modified: libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp?rev=254289&r1=254288&r2=254289&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp Sun Nov 29 23:20:00 2015
@@ -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
}
More information about the cfe-commits
mailing list