summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt8
-rw-r--r--test/libcxx/test/config.py8
-rw-r--r--test/lit.site.cfg.in2
-rw-r--r--test/std/containers/sequences/array/array.data/data_const.pass.cpp14
-rw-r--r--test/std/containers/sequences/array/iterators.pass.cpp33
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp2
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp2
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp2
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp2
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp2
-rw-r--r--test/std/iterators/iterator.range/begin-end.pass.cpp68
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp4
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp4
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp4
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp6
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp32
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp2
-rw-r--r--test/support/external_threads.cpp2
19 files changed, 156 insertions, 45 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index edebaee55408..d174ec72ca08 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -55,18 +55,20 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
@ONLY)
+set(LIBCXX_TEST_DEPS "")
+
if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
- set(experimental_dep cxx_experimental)
+ set(LIBCXX_TEST_DEPS cxx_experimental)
endif()
if (LIBCXX_HAS_EXTERNAL_THREAD_API)
- set(external_threads_dep cxx_external_threads)
+ list(APPEND LIBCXX_TEST_DEPS cxx_external_threads)
endif()
add_lit_testsuite(check-cxx
"Running libcxx tests"
${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS cxx ${experimental_dep} ${external_threads_dep})
+ DEPENDS cxx ${LIBCXX_TEST_DEPS})
add_custom_target(check-libcxx DEPENDS check-cxx)
diff --git a/test/libcxx/test/config.py b/test/libcxx/test/config.py
index 4551845104d2..dd90e7a37430 100644
--- a/test/libcxx/test/config.py
+++ b/test/libcxx/test/config.py
@@ -579,10 +579,6 @@ class Configuration(object):
self.cxx.link_flags += [abs_path]
else:
self.cxx.link_flags += ['-lc++']
- # This needs to come after -lc++ as we want its unresolved thread-api symbols
- # to be picked up from this one.
- if self.get_lit_bool('libcxx_external_thread_api', default=False):
- self.cxx.link_flags += ['-lc++external_threads']
def configure_link_flags_abi_library(self):
cxx_abi = self.get_lit_conf('cxx_abi', 'libcxxabi')
@@ -604,13 +600,15 @@ class Configuration(object):
self.cxx.link_flags += ['-lc++abi']
elif cxx_abi == 'libcxxrt':
self.cxx.link_flags += ['-lcxxrt']
- elif cxx_abi == 'none':
+ elif cxx_abi == 'none' or cxx_abi == 'default':
pass
else:
self.lit_config.fatal(
'C++ ABI setting %s unsupported for tests' % cxx_abi)
def configure_extra_library_flags(self):
+ if self.get_lit_bool('cxx_ext_threads', default=False):
+ self.cxx.link_flags += ['-lc++external_threads']
self.target_info.add_cxx_link_flags(self.cxx.link_flags)
def configure_color_diagnostics(self):
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 741e9c89ac44..c89af09ddbf3 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -28,7 +28,7 @@ config.has_libatomic = "@LIBCXX_HAS_ATOMIC_LIB@"
config.use_libatomic = "@LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB@"
config.libcxxabi_shared = "@LIBCXXABI_ENABLE_SHARED@"
-config.libcxx_external_thread_api = "@LIBCXX_HAS_EXTERNAL_THREAD_API@"
+config.cxx_ext_threads = "@LIBCXX_HAS_EXTERNAL_THREAD_API@"
# Let the main config do the real work.
config.loaded_site_config = True
diff --git a/test/std/containers/sequences/array/array.data/data_const.pass.cpp b/test/std/containers/sequences/array/array.data/data_const.pass.cpp
index 58840e940899..5be082eeb843 100644
--- a/test/std/containers/sequences/array/array.data/data_const.pass.cpp
+++ b/test/std/containers/sequences/array/array.data/data_const.pass.cpp
@@ -14,6 +14,8 @@
#include <array>
#include <cassert>
+#include "test_macros.h"
+
// std::array is explicitly allowed to be initialized with A a = { init-list };.
// Disable the missing braces warning for this reason.
#include "disable_missing_braces_warning.h"
@@ -36,4 +38,16 @@ int main()
const T* p = c.data();
(void)p; // to placate scan-build
}
+#if TEST_STD_VER > 14
+ {
+ typedef std::array<int, 5> C;
+ constexpr C c1{0,1,2,3,4};
+ constexpr const C c2{0,1,2,3,4};
+
+ static_assert ( c1.data() == &c1[0], "");
+ static_assert ( *c1.data() == c1[0], "");
+ static_assert ( c2.data() == &c2[0], "");
+ static_assert ( *c2.data() == c2[0], "");
+ }
+#endif
}
diff --git a/test/std/containers/sequences/array/iterators.pass.cpp b/test/std/containers/sequences/array/iterators.pass.cpp
index 1f9904e1fa71..7d9050800dea 100644
--- a/test/std/containers/sequences/array/iterators.pass.cpp
+++ b/test/std/containers/sequences/array/iterators.pass.cpp
@@ -17,6 +17,10 @@
#include "test_macros.h"
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
@@ -109,4 +113,33 @@ int main()
}
}
#endif
+#if TEST_STD_VER > 14
+ {
+ typedef std::array<int, 5> C;
+ constexpr C c{0,1,2,3,4};
+
+ static_assert ( c.begin() == std::begin(c), "");
+ static_assert ( c.cbegin() == std::cbegin(c), "");
+ static_assert ( c.end() == std::end(c), "");
+ static_assert ( c.cend() == std::cend(c), "");
+
+ static_assert ( c.rbegin() == std::rbegin(c), "");
+ static_assert ( c.crbegin() == std::crbegin(c), "");
+ static_assert ( c.rend() == std::rend(c), "");
+ static_assert ( c.crend() == std::crend(c), "");
+
+ static_assert ( std::begin(c) != std::end(c), "");
+ static_assert ( std::rbegin(c) != std::rend(c), "");
+ static_assert ( std::cbegin(c) != std::cend(c), "");
+ static_assert ( std::crbegin(c) != std::crend(c), "");
+
+ static_assert ( *c.begin() == 0, "");
+ static_assert ( *c.rbegin() == 4, "");
+
+ static_assert ( *std::begin(c) == 0, "" );
+ static_assert ( *std::cbegin(c) == 0, "" );
+ static_assert ( *std::rbegin(c) == 4, "" );
+ static_assert ( *std::crbegin(c) == 4, "" );
+ }
+#endif
}
diff --git a/test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
index ffce81459478..dffdb7885096 100644
--- a/test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
+++ b/test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
@@ -19,7 +19,7 @@ namespace ex = std::experimental;
template <typename T>
using hasFoo = typename T::Foo;
-
+
struct yesFoo {
using Foo = int;
};
diff --git a/test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
index 136fb068be3c..333047511b1c 100644
--- a/test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
+++ b/test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
@@ -19,7 +19,7 @@ namespace ex = std::experimental;
template <typename T>
using callFoo = decltype(std::declval<T&>().Foo());
-
+
struct yesFoo {
int Foo() { return 0; }
};
diff --git a/test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
index d8528a25161e..ab4a54b7f367 100644
--- a/test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
+++ b/test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
@@ -19,7 +19,7 @@ namespace ex = std::experimental;
template <typename T>
using copy_assign_t = decltype(std::declval<T&>() = std::declval<T const &>());
-
+
struct not_assignable {
not_assignable & operator=(const not_assignable&) = delete;
};
diff --git a/test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
index 8d1e0ae825d5..c654a6a076c2 100644
--- a/test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
+++ b/test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
@@ -19,7 +19,7 @@ namespace ex = std::experimental;
template <typename T>
using callFoo = decltype(std::declval<T&>().Foo());
-
+
struct yesFoo {
int Foo() { return 0; }
};
diff --git a/test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
index e9e5d8ce0056..b09763a59f13 100644
--- a/test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
+++ b/test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
@@ -19,7 +19,7 @@ namespace ex = std::experimental;
template <typename T>
using callFoo = decltype(std::declval<T&>().Foo());
-
+
struct yesFoo {
int Foo() { return 0; }
};
diff --git a/test/std/iterators/iterator.range/begin-end.pass.cpp b/test/std/iterators/iterator.range/begin-end.pass.cpp
index 68186919198d..a0774888d567 100644
--- a/test/std/iterators/iterator.range/begin-end.pass.cpp
+++ b/test/std/iterators/iterator.range/begin-end.pass.cpp
@@ -10,12 +10,25 @@
// XFAIL: c++03, c++98
// <iterator>
-// template <class C> auto begin(C& c) -> decltype(c.begin());
-// template <class C> auto begin(const C& c) -> decltype(c.begin());
-// template <class C> auto end(C& c) -> decltype(c.end());
-// template <class C> auto end(const C& c) -> decltype(c.end());
-// template <class E> reverse_iterator<const E*> rbegin(initializer_list<E> il);
-// template <class E> reverse_iterator<const E*> rend(initializer_list<E> il);
+// template <class C> constexpr auto begin(C& c) -> decltype(c.begin());
+// template <class C> constexpr auto begin(const C& c) -> decltype(c.begin());
+// template <class C> constexpr auto cbegin(const C& c) -> decltype(std::begin(c)); // C++14
+// template <class C> constexpr auto cend(const C& c) -> decltype(std::end(c)); // C++14
+// template <class C> constexpr auto end (C& c) -> decltype(c.end());
+// template <class C> constexpr auto end (const C& c) -> decltype(c.end());
+// template <class E> constexpr reverse_iterator<const E*> rbegin(initializer_list<E> il);
+// template <class E> constexpr reverse_iterator<const E*> rend (initializer_list<E> il);
+//
+// template <class C> auto constexpr rbegin(C& c) -> decltype(c.rbegin()); // C++14
+// template <class C> auto constexpr rbegin(const C& c) -> decltype(c.rbegin()); // C++14
+// template <class C> auto constexpr rend(C& c) -> decltype(c.rend()); // C++14
+// template <class C> constexpr auto rend(const C& c) -> decltype(c.rend()); // C++14
+// template <class T, size_t N> reverse_iterator<T*> constexpr rbegin(T (&array)[N]); // C++14
+// template <class T, size_t N> reverse_iterator<T*> constexpr rend(T (&array)[N]); // C++14
+// template <class C> constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14
+// template <class C> constexpr auto crend(const C& c) -> decltype(std::rend(c)); // C++14
+//
+// All of these are constexpr in C++17
#include "test_macros.h"
@@ -26,6 +39,10 @@
#include <list>
#include <initializer_list>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
template<typename C>
void test_const_container( const C & c, typename C::value_type val ) {
assert ( std::begin(c) == c.begin());
@@ -142,4 +159,43 @@ int main(){
constexpr const int *e = std::cend(arrA);
static_assert(e - b == 3, "");
#endif
+
+#if TEST_STD_VER > 14
+ {
+ typedef std::array<int, 5> C;
+ constexpr const C c{0,1,2,3,4};
+
+ static_assert ( c.begin() == std::begin(c), "");
+ static_assert ( c.cbegin() == std::cbegin(c), "");
+ static_assert ( c.end() == std::end(c), "");
+ static_assert ( c.cend() == std::cend(c), "");
+
+ static_assert ( c.rbegin() == std::rbegin(c), "");
+ static_assert ( c.crbegin() == std::crbegin(c), "");
+ static_assert ( c.rend() == std::rend(c), "");
+ static_assert ( c.crend() == std::crend(c), "");
+
+ static_assert ( std::begin(c) != std::end(c), "");
+ static_assert ( std::rbegin(c) != std::rend(c), "");
+ static_assert ( std::cbegin(c) != std::cend(c), "");
+ static_assert ( std::crbegin(c) != std::crend(c), "");
+
+ static_assert ( *c.begin() == 0, "");
+ static_assert ( *c.rbegin() == 4, "");
+
+ static_assert ( *std::begin(c) == 0, "" );
+ static_assert ( *std::cbegin(c) == 0, "" );
+ static_assert ( *std::rbegin(c) == 4, "" );
+ static_assert ( *std::crbegin(c) == 4, "" );
+ }
+
+ {
+ static constexpr const int c[] = {0,1,2,3,4};
+
+ static_assert ( *std::begin(c) == 0, "" );
+ static_assert ( *std::cbegin(c) == 0, "" );
+ static_assert ( *std::rbegin(c) == 4, "" );
+ static_assert ( *std::crbegin(c) == 4, "" );
+ }
+#endif
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
index 9effb6eded37..ef3b9302c7a2 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
@@ -42,6 +42,7 @@ void test_no_inner_alloc()
using SA = std::scoped_allocator_adaptor<Alloc>;
static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Alloc CA(P);
SA A(CA);
const PairIn in(x, std::move(y));
@@ -68,6 +69,7 @@ void test_no_inner_alloc()
using SA = std::scoped_allocator_adaptor<Alloc>;
static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Alloc CA(P);
SA A(CA);
const PairIn in(x, y);
@@ -104,6 +106,7 @@ void test_with_inner_alloc()
static_assert(!std::uses_allocator<T, Outer>::value, "");
static_assert(std::uses_allocator<T, Inner>::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Outer O(POuter);
Inner I(PInner);
SA A(O, I);
@@ -134,6 +137,7 @@ void test_with_inner_alloc()
static_assert(!std::uses_allocator<T, Outer>::value, "");
static_assert(std::uses_allocator<T, Inner>::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Outer O(POuter);
Inner I(PInner);
SA A(O, I);
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
index 4d371f206e65..6f31d264280a 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
@@ -42,6 +42,7 @@ void test_no_inner_alloc()
using SA = std::scoped_allocator_adaptor<Alloc>;
static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Alloc CA(P);
SA A(CA);
A.construct(ptr, std::piecewise_construct,
@@ -68,6 +69,7 @@ void test_no_inner_alloc()
using SA = std::scoped_allocator_adaptor<Alloc>;
static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Alloc CA(P);
SA A(CA);
A.construct(ptr, std::piecewise_construct,
@@ -104,6 +106,7 @@ void test_with_inner_alloc()
static_assert(!std::uses_allocator<T, Outer>::value, "");
static_assert(std::uses_allocator<T, Inner>::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Outer O(POuter);
Inner I(PInner);
SA A(O, I);
@@ -134,6 +137,7 @@ void test_with_inner_alloc()
static_assert(!std::uses_allocator<T, Outer>::value, "");
static_assert(std::uses_allocator<T, Inner>::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Outer O(POuter);
Inner I(PInner);
SA A(O, I);
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
index 1d0fb5157c02..a761b3288060 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
@@ -42,6 +42,7 @@ void test_no_inner_alloc()
using SA = std::scoped_allocator_adaptor<Alloc>;
static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Alloc CA(P);
SA A(CA);
PairIn in(x, std::move(y));
@@ -68,6 +69,7 @@ void test_no_inner_alloc()
using SA = std::scoped_allocator_adaptor<Alloc>;
static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Alloc CA(P);
SA A(CA);
PairIn in(x, y);
@@ -104,6 +106,7 @@ void test_with_inner_alloc()
static_assert(!std::uses_allocator<T, Outer>::value, "");
static_assert(std::uses_allocator<T, Inner>::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Outer O(POuter);
Inner I(PInner);
SA A(O, I);
@@ -134,6 +137,7 @@ void test_with_inner_alloc()
static_assert(!std::uses_allocator<T, Outer>::value, "");
static_assert(std::uses_allocator<T, Inner>::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Outer O(POuter);
Inner I(PInner);
SA A(O, I);
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
index 840f4ecc616d..de33eeb2fbda 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
@@ -41,6 +41,7 @@ void test_no_inner_alloc()
using SA = std::scoped_allocator_adaptor<Alloc>;
static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Alloc CA(P);
SA A(CA);
A.construct(ptr, x, std::move(y));
@@ -65,6 +66,7 @@ void test_no_inner_alloc()
using SA = std::scoped_allocator_adaptor<Alloc>;
static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Alloc CA(P);
SA A(CA);
A.construct(ptr, std::move(x), y);
@@ -99,6 +101,7 @@ void test_with_inner_alloc()
static_assert(!std::uses_allocator<T, Outer>::value, "");
static_assert(std::uses_allocator<T, Inner>::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Outer O(POuter);
Inner I(PInner);
SA A(O, I);
@@ -127,6 +130,7 @@ void test_with_inner_alloc()
static_assert(!std::uses_allocator<T, Outer>::value, "");
static_assert(std::uses_allocator<T, Inner>::value, "");
Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
Outer O(POuter);
Inner I(PInner);
SA A(O, I);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
index 50c6f17efbef..3f132e47b626 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
@@ -21,7 +21,7 @@
int main()
{
- (void)std::tuple_size<std::tuple<> &>::value; // expected-error {{no member named 'value'}}
- (void)std::tuple_size<int>::value; // expected-error {{no member named 'value'}}
- (void)std::tuple_size<std::tuple<>*>::value; // expected-error {{no member named 'value'}}
+ (void)std::tuple_size<std::tuple<> &>::value; // expected-error {{implicit instantiation of undefined template}}
+ (void)std::tuple_size<int>::value; // expected-error {{implicit instantiation of undefined template}}
+ (void)std::tuple_size<std::tuple<>*>::value; // expected-error {{implicit instantiation of undefined template}}
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp
index 40214f632e75..3e4145c79cb5 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp
@@ -18,8 +18,6 @@
// UNSUPPORTED: c++98, c++03
#include <tuple>
-#include <utility>
-#include <array>
#include <type_traits>
template <class T, class = decltype(std::tuple_size<T>::value)>
@@ -27,27 +25,29 @@ constexpr bool has_value(int) { return true; }
template <class> constexpr bool has_value(long) { return false; }
template <class T> constexpr bool has_value() { return has_value<T>(0); }
+struct Dummy {};
template <class T, std::size_t N>
void test()
{
- static_assert(has_value<T>(), "");
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
std::tuple_size<T> >::value), "");
- static_assert(has_value<const T>(), "");
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
std::tuple_size<const T> >::value), "");
- static_assert(has_value<volatile T>(), "");
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
std::tuple_size<volatile T> >::value), "");
-
- static_assert(has_value<const volatile T>(), "");
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
std::tuple_size<const volatile T> >::value), "");
- {
- static_assert(!has_value<T &>(), "");
- static_assert(!has_value<T *>(), "");
- }
+}
+
+void test_tuple_size_value_sfinae() {
+ // Test that the ::value member does not exist
+ static_assert(has_value<std::tuple<int> const>(), "");
+ static_assert(has_value<std::pair<int, long> volatile>(), "");
+ static_assert(!has_value<int>(), "");
+ static_assert(!has_value<const int>(), "");
+ static_assert(!has_value<volatile void>(), "");
+ static_assert(!has_value<const volatile std::tuple<int>&>(), "");
}
int main()
@@ -56,13 +56,5 @@ int main()
test<std::tuple<int>, 1>();
test<std::tuple<char, int>, 2>();
test<std::tuple<char, char*, int>, 3>();
- test<std::pair<int, void*>, 2>();
- test<std::array<int, 42>, 42>();
- {
- static_assert(!has_value<void>(), "");
- static_assert(!has_value<void*>(), "");
- static_assert(!has_value<int>(), "");
- static_assert(!has_value<std::pair<int, int>*>(), "");
- static_assert(!has_value<std::array<int, 42>&>(), "");
- }
+ test_tuple_size_value_sfinae();
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp
index 700dd95c959c..957a683b47f8 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp
@@ -22,5 +22,5 @@ int main()
(void)std::tuple_size_v<std::tuple<> &>; // expected-note {{requested here}}
(void)std::tuple_size_v<int>; // expected-note {{requested here}}
(void)std::tuple_size_v<std::tuple<>*>; // expected-note {{requested here}}
- // expected-error@tuple:* 3 {{no member named 'value'}}
+ // expected-error@tuple:* 3 {{implicit instantiation of undefined template}}
}
diff --git a/test/support/external_threads.cpp b/test/support/external_threads.cpp
index 381ec651eefc..68ba96ff879e 100644
--- a/test/support/external_threads.cpp
+++ b/test/support/external_threads.cpp
@@ -6,5 +6,5 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#define _LIBCPP_BUILDING_EXTERNAL_THREADS
+#define _LIBCPP_BUILDING_THREAD_API_EXTERNAL_PTHREAD
#include <__threading_support>