Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER.
This is a huge cleanup that helps make the libc++ test suite more portable. Patch from STL@microsoft.com. Thanks STL! git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272716 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -57,13 +57,13 @@ test()
|
||||
test<Iter>(1000);
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr int il[] = { 2, 4, 6, 8, 7, 5, 3, 1 };
|
||||
#endif
|
||||
|
||||
void constexpr_test()
|
||||
{
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr auto p = std::max_element(il,il+8);
|
||||
static_assert ( *p == 8, "" );
|
||||
#endif
|
||||
|
||||
@@ -75,14 +75,14 @@ void test_eq()
|
||||
delete [] a;
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr int il[] = { 2, 4, 6, 8, 7, 5, 3, 1 };
|
||||
struct less { constexpr bool operator ()( const int &x, const int &y) const { return x < y; }};
|
||||
#endif
|
||||
|
||||
void constexpr_test()
|
||||
{
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr auto p = std::max_element(il, il+8, less());
|
||||
static_assert ( *p == 8, "" );
|
||||
#endif
|
||||
|
||||
@@ -57,13 +57,13 @@ test()
|
||||
test<Iter>(1000);
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr int il[] = { 2, 4, 6, 8, 7, 5, 3, 1 };
|
||||
#endif
|
||||
|
||||
void constexpr_test()
|
||||
{
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr auto p = std::min_element(il, il+8);
|
||||
static_assert ( *p == 1, "" );
|
||||
#endif
|
||||
|
||||
@@ -75,14 +75,14 @@ void test_eq()
|
||||
delete [] a;
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr int il[] = { 2, 4, 6, 8, 7, 5, 3, 1 };
|
||||
struct less { constexpr bool operator ()( const int &x, const int &y) const { return x < y; }};
|
||||
#endif
|
||||
|
||||
void constexpr_test()
|
||||
{
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr auto p = std::min_element(il, il+8, less());
|
||||
static_assert(*p == 1, "");
|
||||
#endif
|
||||
|
||||
@@ -74,13 +74,13 @@ test()
|
||||
}
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr int il[] = { 2, 4, 6, 8, 7, 5, 3, 1 };
|
||||
#endif
|
||||
|
||||
void constexpr_test()
|
||||
{
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr auto p = std::minmax_element(il, il+8);
|
||||
static_assert ( *(p.first) == 1, "" );
|
||||
static_assert ( *(p.second) == 8, "" );
|
||||
|
||||
@@ -79,14 +79,14 @@ test()
|
||||
}
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr int il[] = { 2, 4, 6, 8, 7, 5, 3, 1 };
|
||||
struct less { constexpr bool operator ()( const int &x, const int &y) const { return x < y; }};
|
||||
#endif
|
||||
|
||||
void constexpr_test()
|
||||
{
|
||||
#if __cplusplus >= 201402L
|
||||
#if TEST_STD_VER >= 14
|
||||
constexpr auto p = std::minmax_element(il, il+8, less());
|
||||
static_assert ( *(p.first) == 1, "" );
|
||||
static_assert ( *(p.second) == 8, "" );
|
||||
|
||||
Reference in New Issue
Block a user