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:
Eric Fiselier
2016-06-14 21:31:42 +00:00
parent 174432dbd5
commit d24c465bea
827 changed files with 1085 additions and 988 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -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, "" );

View File

@@ -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, "" );