From d23de13b3208b94a25e1de463ea3155911512e61 Mon Sep 17 00:00:00 2001
From: Dimitry Andric
Date: Mon, 26 Jun 2017 20:33:34 +0000
Subject: [PATCH 1/5] Vendor import of libc++ trunk r306325:
https://llvm.org/svn/llvm-project/libcxx/trunk@306325
---
CMakeLists.txt | 1 +
include/__config | 15 +-
include/experimental/any | 9 +-
include/new | 20 +--
include/numeric | 87 ++++++++++
include/variant | 2 +
src/experimental/filesystem/path.cpp | 5 +-
.../alg.foreach/for_each_n.pass.cpp | 10 +-
.../any/any.class/any.assign/copy.pass.cpp | 7 +-
.../any/any.class/any.assign/move.pass.cpp | 7 +-
.../any/any.class/any.assign/value.pass.cpp | 7 +-
.../any/any.class/any.cons/copy.pass.cpp | 7 +-
.../any/any.class/any.cons/move.pass.cpp | 7 +-
.../any/any.class/any.cons/value.pass.cpp | 7 +-
.../any.class/any.modifiers/clear.pass.cpp | 7 +-
.../any/any.class/any.modifiers/swap.pass.cpp | 7 +-
.../iterator.operations/advance.pass.cpp | 2 +-
.../iterator.operations/prev.pass.cpp | 2 +-
.../new_deployment.fail.cpp | 36 ++++
.../exclusive.scan/exclusive_scan.pass.cpp | 6 +-
.../exclusive_scan_init_op.pass.cpp | 5 +-
.../inclusive.scan/inclusive_scan.pass.cpp | 102 +++++++++++
.../inclusive.scan/inclusive_scan_op.pass.cpp | 112 ++++++++++++
.../inclusive_scan_op_init.pass.cpp | 128 ++++++++++++++
.../reduce/reduce_init_op.pass.cpp | 2 +-
...sform_exclusive_scan_init_bop_uop.pass.cpp | 8 +-
.../transform_inclusive_scan_bop_uop.pass.cpp | 133 +++++++++++++++
...sform_inclusive_scan_bop_uop_init.pass.cpp | 160 ++++++++++++++++++
...orm_reduce_iter_iter_init_bop_uop.pass.cpp | 8 +-
...nsform_reduce_iter_iter_iter_init.pass.cpp | 4 +-
..._reduce_iter_iter_iter_init_op_op.pass.cpp | 8 +-
.../allocator.adaptor.cnstr/allocs.pass.cpp | 2 +-
.../func.wrap.func.con/copy_move.pass.cpp | 2 +-
.../optional.object.ctor/move.pass.cpp | 2 +-
.../tuple.tuple/tuple.cnstr/dtor.pass.cpp | 2 +-
.../tuple_size_structured_bindings.pass.cpp | 16 +-
.../utility/pairs/pairs.pair/dtor.pass.cpp | 2 +-
.../variant.variant/variant.ctor/T.pass.cpp | 14 ++
test/support/count_new.hpp | 15 +-
test/support/experimental_any_helpers.h | 2 +
www/upcoming_meeting.html | 84 +++------
41 files changed, 899 insertions(+), 163 deletions(-)
create mode 100644 test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp
create mode 100644 test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
create mode 100644 test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
create mode 100644 test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
create mode 100644 test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
create mode 100644 test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 33d888b807da..5b5971036b88 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -118,6 +118,7 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
cxxabi.h
PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi/include
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
+ ${LLVM_MAIN_SRC_DIR}/../libcxxabi/include
NO_DEFAULT_PATH
)
if (LIBCXX_TARGETING_MSVC)
diff --git a/include/__config b/include/__config
index fc24a3bc9ba9..aae053102f55 100644
--- a/include/__config
+++ b/include/__config
@@ -1154,6 +1154,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
__attribute__((availability(watchos,strict,introduced=3.0)))
#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable))
+#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST __attribute__((unavailable))
#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
__attribute__((availability(macosx,strict,introduced=10.12))) \
__attribute__((availability(ios,strict,introduced=10.0))) \
@@ -1175,25 +1176,35 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
__attribute__((availability(macosx,strict,introduced=10.9))) \
__attribute__((availability(ios,strict,introduced=7.0)))
+#define _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION \
+ __attribute__((availability(macosx,strict,introduced=10.13))) \
+ __attribute__((availability(ios,strict,introduced=11.0))) \
+ __attribute__((availability(tvos,strict,introduced=11.0))) \
+ __attribute__((availability(watchos,strict,introduced=4.0)))
#else
#define _LIBCPP_AVAILABILITY_SHARED_MUTEX
#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
#define _LIBCPP_AVAILABILITY_FUTURE_ERROR
#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+#define _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION
#endif
// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
#ifdef _LIBCPP_NO_EXCEPTIONS
#define _LIBCPP_AVAILABILITY_DYNARRAY
#define _LIBCPP_AVAILABILITY_FUTURE
+#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
#else
#define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
#define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
+#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST \
+ _LIBCPP_AVAILABILITY_BAD_ANY_CAST
#endif
// Availability of stream API in the dylib got dropped and re-added. The
@@ -1202,9 +1213,9 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
// availability(ios,introduced=7.0)
#if defined(_LIBCPP_USE_AVAILABILITY_APPLE) && \
((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
- __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1090) || \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090) || \
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
- __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ <= 70000))
+ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000))
#define _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
#endif
diff --git a/include/experimental/any b/include/experimental/any
index 022b379e858b..083a2909033c 100644
--- a/include/experimental/any
+++ b/include/experimental/any
@@ -89,7 +89,7 @@ inline namespace fundamentals_v1 {
_LIBCPP_BEGIN_NAMESPACE_LFTS
-class _LIBCPP_EXCEPTION_ABI bad_any_cast : public bad_cast
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
{
public:
virtual const char* what() const _NOEXCEPT;
@@ -98,6 +98,7 @@ public:
#if _LIBCPP_STD_VER > 11 // C++ > 11
_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
void __throw_bad_any_cast()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
@@ -506,7 +507,7 @@ void swap(any & __lhs, any & __rhs) _NOEXCEPT
}
template
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
_ValueType any_cast(any const & __v)
{
static_assert(
@@ -522,7 +523,7 @@ _ValueType any_cast(any const & __v)
}
template
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
_ValueType any_cast(any & __v)
{
static_assert(
@@ -537,7 +538,7 @@ _ValueType any_cast(any & __v)
}
template
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
_ValueType any_cast(any && __v)
{
static_assert(
diff --git a/include/new b/include/new
index 34df2efee09e..3945faee0e38 100644
--- a/include/new
+++ b/include/new
@@ -193,20 +193,20 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operato
#endif
#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete(void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
#endif
-_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
#endif
#endif
diff --git a/include/numeric b/include/numeric
index 39e81934dfa1..1b7d97c5be07 100644
--- a/include/numeric
+++ b/include/numeric
@@ -81,6 +81,20 @@ template
+ OutputIterator
+ inclusive_scan(InputIterator first, InputIterator last, OutputIterator result); // C++17
+
+template
+ OutputIterator
+ inclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result, BinaryOperation binary_op); // C++17
+
+template
+ OutputIterator
+ inclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result, BinaryOperation binary_op, T init); // C++17
+
template
OutputIterator
@@ -88,6 +102,21 @@ template
+ OutputIterator
+ transform_inclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result,
+ BinaryOperation binary_op, UnaryOperation unary_op); // C++17
+
+template
+ OutputIterator
+ transform_inclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result,
+ BinaryOperation binary_op, UnaryOperation unary_op,
+ T init); // C++17
+
template
OutputIterator
adjacent_difference(InputIterator first, InputIterator last, OutputIterator result);
@@ -295,6 +324,38 @@ exclusive_scan(_InputIterator __first, _InputIterator __last,
return _VSTD::exclusive_scan(__first, __last, __result, __init, _VSTD::plus<>());
}
+template
+_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryOp __b, _Tp __init)
+{
+ for (; __first != __last; ++__first, (void) ++__result) {
+ __init = __b(__init, *__first);
+ *__result = __init;
+ }
+ return __result;
+}
+
+template
+_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryOp __b)
+{
+ if (__first != __last) {
+ typename std::iterator_traits<_InputIterator>::value_type __init = *__first;
+ *__result++ = __init;
+ if (++__first != __last)
+ return _VSTD::inclusive_scan(__first, __last, __result, __b, __init);
+ }
+
+ return __result;
+}
+
+template
+_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result)
+{
+ return _VSTD::inclusive_scan(__first, __last, __result, std::plus<>());
+}
+
template
inline _LIBCPP_INLINE_VISIBILITY
@@ -316,6 +377,32 @@ transform_exclusive_scan(_InputIterator __first, _InputIterator __last,
}
return __result;
}
+
+template
+_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryOp __b, _UnaryOp __u, _Tp __init)
+{
+ for (; __first != __last; ++__first, (void) ++__result) {
+ __init = __b(__init, __u(*__first));
+ *__result = __init;
+ }
+
+ return __result;
+}
+
+template
+_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryOp __b, _UnaryOp __u)
+{
+ if (__first != __last) {
+ typename std::iterator_traits<_InputIterator>::value_type __init = __u(*__first);
+ *__result++ = __init;
+ if (++__first != __last)
+ return _VSTD::transform_inclusive_scan(__first, __last, __result, __b, __u, __init);
+ }
+
+ return __result;
+}
#endif
template
diff --git a/include/variant b/include/variant
index 8711ef6eb387..f8d3e28bae45 100644
--- a/include/variant
+++ b/include/variant
@@ -1116,6 +1116,8 @@ public:
template <
class _Arg,
enable_if_t, variant>, int> = 0,
+ enable_if_t>::value, int> = 0,
+ enable_if_t>::value, int> = 0,
class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>,
size_t _Ip =
__find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
diff --git a/src/experimental/filesystem/path.cpp b/src/experimental/filesystem/path.cpp
index f49d4cd2d418..dd4026cfe13a 100644
--- a/src/experimental/filesystem/path.cpp
+++ b/src/experimental/filesystem/path.cpp
@@ -261,7 +261,8 @@ struct PathParser {
string_view_pair separate_filename(string_view_t const & s) {
if (s == "." || s == ".." || s.empty()) return string_view_pair{s, ""};
auto pos = s.find_last_of('.');
- if (pos == string_view_t::npos) return string_view_pair{s, string_view{}};
+ if (pos == string_view_t::npos)
+ return string_view_pair{s, string_view_t{}};
return string_view_pair{s.substr(0, pos), s.substr(pos)};
}
@@ -396,7 +397,7 @@ int path::__compare(string_view_t __s) const {
size_t hash_value(const path& __p) noexcept {
auto PP = PathParser::CreateBegin(__p.native());
size_t hash_value = 0;
- std::hash hasher;
+ std::hash hasher;
while (PP) {
hash_value = __hash_combine(hash_value, hasher(*PP));
++PP;
diff --git a/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
index fd24edb43060..9b391f01cea5 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
@@ -36,15 +36,15 @@ int main()
auto f = for_each_test(0);
Iter it = std::for_each_n(Iter(ia), 0, std::ref(f));
assert(it == Iter(ia));
- assert(f.count == 0);
+ assert(f.count == 0);
}
{
auto f = for_each_test(0);
Iter it = std::for_each_n(Iter(ia), s, std::ref(f));
-
+
assert(it == Iter(ia+s));
- assert(f.count == s);
+ assert(f.count == s);
for (unsigned i = 0; i < s; ++i)
assert(ia[i] == static_cast(i+1));
}
@@ -52,9 +52,9 @@ int main()
{
auto f = for_each_test(0);
Iter it = std::for_each_n(Iter(ia), 1, std::ref(f));
-
+
assert(it == Iter(ia+1));
- assert(f.count == 1);
+ assert(f.count == 1);
for (unsigned i = 0; i < 1; ++i)
assert(ia[i] == static_cast(i+2));
}
diff --git a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp b/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
index 7140fab88feb..0b9d71e5f705 100644
--- a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
+++ b/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
@@ -9,12 +9,7 @@
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: availability=macosx
//
diff --git a/test/std/experimental/any/any.class/any.assign/move.pass.cpp b/test/std/experimental/any/any.class/any.assign/move.pass.cpp
index 35fc56c24d3f..72351aeae68f 100644
--- a/test/std/experimental/any/any.class/any.assign/move.pass.cpp
+++ b/test/std/experimental/any/any.class/any.assign/move.pass.cpp
@@ -9,12 +9,7 @@
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: availability=macosx
//
diff --git a/test/std/experimental/any/any.class/any.assign/value.pass.cpp b/test/std/experimental/any/any.class/any.assign/value.pass.cpp
index 8ff4ad594151..cd4646fb5fd5 100644
--- a/test/std/experimental/any/any.class/any.assign/value.pass.cpp
+++ b/test/std/experimental/any/any.class/any.assign/value.pass.cpp
@@ -9,12 +9,7 @@
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: availability=macosx
//
diff --git a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp b/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
index 47f12d739236..d477394c0b91 100644
--- a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
@@ -9,12 +9,7 @@
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: availability=macosx
//
diff --git a/test/std/experimental/any/any.class/any.cons/move.pass.cpp b/test/std/experimental/any/any.class/any.cons/move.pass.cpp
index c5395daa3da6..ef980ca5f222 100644
--- a/test/std/experimental/any/any.class/any.cons/move.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/move.pass.cpp
@@ -9,12 +9,7 @@
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: availability=macosx
//
diff --git a/test/std/experimental/any/any.class/any.cons/value.pass.cpp b/test/std/experimental/any/any.class/any.cons/value.pass.cpp
index fcace5028eca..d37990e6ca37 100644
--- a/test/std/experimental/any/any.class/any.cons/value.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/value.pass.cpp
@@ -9,12 +9,7 @@
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: availability=macosx
//
diff --git a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
index 1b0b75d61fee..a19bd38f129b 100644
--- a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
+++ b/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
@@ -9,12 +9,7 @@
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: availability=macosx
//
diff --git a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
index 9f499b4a1fb3..8de582a6b76e 100644
--- a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
+++ b/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
@@ -9,12 +9,7 @@
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: availability=macosx
//
diff --git a/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp b/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp
index e5bd5603b8e3..ff1b3e7ead43 100644
--- a/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp
+++ b/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp
@@ -35,7 +35,7 @@ test(It i, typename std::iterator_traits::difference_type n, It x)
#if TEST_STD_VER > 14
template
-constexpr bool
+constexpr bool
constepxr_test(It i, typename std::iterator_traits::difference_type n, It x)
{
std::advance(i, n);
diff --git a/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp b/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
index 465cda1c47e4..1eb91881fe11 100644
--- a/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
+++ b/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
@@ -71,5 +71,5 @@ int main()
static_assert( constexpr_test(s+1, s), "" );
}
#endif
-
+
}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp
new file mode 100644
index 000000000000..f9f487dc7ef8
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// REQUIRES: availability=macosx10.12
+
+// test availability of new/delete operators introduced in c++17.
+
+#include
+
+int main () {
+ int *p0 = new ((std::align_val_t)16) int(1);
+ (void)p0;
+ int *p1 = new ((std::align_val_t)16) int[1];
+ (void)p1;
+ // expected-error@-4 {{call to unavailable function 'operator new': introduced in macOS 10.13}}
+ // expected-note@new:* {{candidate function has been explicitly made unavailable}}
+ // expected-note@new:* {{candidate function not viable: no known conversion from 'std::align_val_t' to 'const std::nothrow_t' for 2nd argument}}
+ // expected-note@new:* {{candidate function not viable: no known conversion from 'std::align_val_t' to 'void *' for 2nd argument}}
+ // expected-note@new:* {{candidate function not viable: requires single argument '__sz', but 2 arguments were provided}}
+ // expected-note@new:* {{candidate function not viable: requires 3 arguments, but 2 were provided}}
+
+ // expected-error@-9 {{call to unavailable function 'operator new[]': introduced in macOS 10.13}}
+ // expected-note@new:* {{candidate function has been explicitly made unavailable}}
+ // expected-note@new:* {{candidate function not viable: no known conversion from 'std::align_val_t' to 'const std::nothrow_t' for 2nd argument}}
+ // expected-note@new:* {{candidate function not viable: no known conversion from 'std::align_val_t' to 'void *' for 2nd argument}}
+ // expected-note@new:* {{candidate function not viable: requires single argument '__sz', but 2 arguments were provided}}
+ // expected-note@new:* {{candidate function not viable: requires 3 arguments, but 2 were provided}}
+ return 0;
+}
diff --git a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
index 6fdd288e2d6a..34181f508e2a 100644
--- a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
+++ b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
@@ -13,7 +13,7 @@
// template
// OutputIterator exclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result, T init);
-//
+//
#include
#include
@@ -26,7 +26,7 @@ void
test(Iter1 first, Iter1 last, T init, Iter2 rFirst, Iter2 rLast)
{
std::vector::value_type> v;
-
+
// Not in place
std::exclusive_scan(first, last, std::back_inserter(v), init);
assert(std::equal(v.begin(), v.end(), rFirst, rLast));
@@ -35,7 +35,7 @@ test(Iter1 first, Iter1 last, T init, Iter2 rFirst, Iter2 rLast)
v.clear();
v.assign(first, last);
std::exclusive_scan(v.begin(), v.end(), v.begin(), init);
- assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
}
diff --git a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
index ba1673fe467f..c15cb1661e25 100644
--- a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
+++ b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
@@ -13,7 +13,7 @@
// template
// OutputIterator
// exclusive_scan(InputIterator first, InputIterator last,
-// OutputIterator result,
+// OutputIterator result,
// T init, BinaryOperation binary_op); // C++17
#include
@@ -36,7 +36,7 @@ test(Iter1 first, Iter1 last, T init, Op op, Iter2 rFirst, Iter2 rLast)
v.clear();
v.assign(first, last);
std::exclusive_scan(v.begin(), v.end(), v.begin(), init, op);
- assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
}
@@ -84,4 +84,3 @@ int main()
}
}
}
-
\ No newline at end of file
diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
new file mode 100644
index 000000000000..af5b1f0d3717
--- /dev/null
+++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
@@ -0,0 +1,102 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// template
+// OutputIterator inclusive_scan(InputIterator first, InputIterator last,
+// OutputIterator result, T init);
+//
+
+#include
+#include
+#include
+
+#include "test_iterators.h"
+
+template
+void
+test(Iter1 first, Iter1 last, Iter2 rFirst, Iter2 rLast)
+{
+ std::vector::value_type> v;
+
+// Not in place
+ std::inclusive_scan(first, last, std::back_inserter(v));
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+
+// In place
+ v.clear();
+ v.assign(first, last);
+ std::inclusive_scan(v.begin(), v.end(), v.begin());
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+}
+
+
+template
+void
+test()
+{
+ int ia[] = {1, 3, 5, 7, 9};
+ const int pRes[] = {1, 4, 9, 16, 25};
+ const unsigned sa = sizeof(ia) / sizeof(ia[0]);
+ static_assert(sa == sizeof(pRes) / sizeof(pRes[0])); // just to be sure
+
+ for (unsigned int i = 0; i < sa; ++i )
+ test(Iter(ia), Iter(ia + i), pRes, pRes + i);
+}
+
+int triangle(int n) { return n*(n+1)/2; }
+
+// Basic sanity
+void basic_tests()
+{
+ {
+ std::vector v(10);
+ std::fill(v.begin(), v.end(), 3);
+ std::inclusive_scan(v.begin(), v.end(), v.begin());
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == (int)(i+1) * 3);
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 0);
+ std::inclusive_scan(v.begin(), v.end(), v.begin());
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == triangle(i));
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 1);
+ std::inclusive_scan(v.begin(), v.end(), v.begin());
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == triangle(i + 1));
+ }
+
+ {
+ std::vector v, res;
+ std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res));
+ assert(res.empty());
+ }
+}
+
+int main()
+{
+ basic_tests();
+
+// All the iterator categories
+ test >();
+ test >();
+ test >();
+ test >();
+ test();
+ test< int*>();
+}
diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
new file mode 100644
index 000000000000..95db56bf67d2
--- /dev/null
+++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
@@ -0,0 +1,112 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// template
+// OutputIterator
+// inclusive_scan(InputIterator first, InputIterator last,
+// OutputIterator result,
+// BinaryOperation binary_op); // C++17
+
+#include
+#include
+#include
+#include
+
+#include "test_iterators.h"
+
+template
+void
+test(Iter1 first, Iter1 last, Op op, Iter2 rFirst, Iter2 rLast)
+{
+ std::vector::value_type> v;
+
+// Not in place
+ std::inclusive_scan(first, last, std::back_inserter(v), op);
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+
+// In place
+ v.clear();
+ v.assign(first, last);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), op);
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+}
+
+
+template
+void
+test()
+{
+ int ia[] = {1, 3, 5, 7, 9};
+ const int pRes[] = {1, 4, 9, 16, 25};
+ const int mRes[] = {1, 3, 15, 105, 945};
+ const unsigned sa = sizeof(ia) / sizeof(ia[0]);
+ static_assert(sa == sizeof(pRes) / sizeof(pRes[0])); // just to be sure
+ static_assert(sa == sizeof(mRes) / sizeof(mRes[0])); // just to be sure
+
+ for (unsigned int i = 0; i < sa; ++i ) {
+ test(Iter(ia), Iter(ia + i), std::plus<>(), pRes, pRes + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), mRes, mRes + i);
+ }
+}
+
+int triangle(int n) { return n*(n+1)/2; }
+
+// Basic sanity
+void basic_tests()
+{
+ {
+ std::vector v(10);
+ std::fill(v.begin(), v.end(), 3);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == (int)(i+1) * 3);
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 0);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == triangle(i));
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 1);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == triangle(i + 1));
+ }
+
+ {
+ std::vector v, res;
+ std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>());
+ assert(res.empty());
+ }
+}
+
+
+int main()
+{
+
+ basic_tests();
+
+// All the iterator categories
+// test >();
+// test >();
+// test >();
+// test >();
+// test();
+// test< int*>();
+
+}
+
\ No newline at end of file
diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
new file mode 100644
index 000000000000..04913f904885
--- /dev/null
+++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
@@ -0,0 +1,128 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// template
+// OutputIterator
+// inclusive_scan(InputIterator first, InputIterator last,
+// OutputIterator result,
+// BinaryOperation binary_op, T init); // C++17
+
+#include
+#include
+#include
+
+#include "test_iterators.h"
+
+template
+void
+test(Iter1 first, Iter1 last, Op op, T init, Iter2 rFirst, Iter2 rLast)
+{
+ std::vector::value_type> v;
+
+// Not in place
+ std::inclusive_scan(first, last, std::back_inserter(v), op, init);
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+
+// In place
+ v.clear();
+ v.assign(first, last);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), op, init);
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+}
+
+
+template
+void
+test()
+{
+ int ia[] = {1, 3, 5, 7, 9};
+ const int pRes[] = {1, 4, 9, 16, 25};
+ const int mRes[] = {1, 3, 15, 105, 945};
+ const unsigned sa = sizeof(ia) / sizeof(ia[0]);
+ static_assert(sa == sizeof(pRes) / sizeof(pRes[0])); // just to be sure
+ static_assert(sa == sizeof(mRes) / sizeof(mRes[0])); // just to be sure
+
+ for (unsigned int i = 0; i < sa; ++i ) {
+ test(Iter(ia), Iter(ia + i), std::plus<>(), 0, pRes, pRes + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), 1, mRes, mRes + i);
+ }
+}
+
+int triangle(int n) { return n*(n+1)/2; }
+
+// Basic sanity
+void basic_tests()
+{
+ {
+ std::vector v(10);
+ std::fill(v.begin(), v.end(), 3);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), 50);
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == 50 + (int)(i+1) * 3);
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 0);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), 40);
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == 40 + triangle(i));
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 1);
+ std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), 30);
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == 30 + triangle(i + 1));
+ }
+
+ {
+ std::vector v, res;
+ std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), 40);
+ assert(res.empty());
+ }
+
+// Make sure that the calculations are done using the init typedef
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 1);
+ std::vector res;
+ std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), 1);
+
+ assert(res.size() == 10);
+ int j = 1;
+ assert(res[0] == 1);
+ for (size_t i = 1; i < v.size(); ++i)
+ {
+ j *= i + 1;
+ assert(res[i] == j);
+ }
+ }
+}
+
+
+int main()
+{
+
+ basic_tests();
+
+// All the iterator categories
+ test >();
+ test >();
+ test >();
+ test >();
+ test();
+ test< int*>();
+
+}
+
\ No newline at end of file
diff --git a/test/std/numerics/numeric.ops/reduce/reduce_init_op.pass.cpp b/test/std/numerics/numeric.ops/reduce/reduce_init_op.pass.cpp
index 5238a1f2ed5b..e3e2ffe7be0c 100644
--- a/test/std/numerics/numeric.ops/reduce/reduce_init_op.pass.cpp
+++ b/test/std/numerics/numeric.ops/reduce/reduce_init_op.pass.cpp
@@ -12,7 +12,7 @@
// template
// T reduce(InputIterator first, InputIterator last, T init, BinaryOperation op);
-
+
#include
#include
diff --git a/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
index 2370e9ea9137..d96d4d6ec439 100644
--- a/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
@@ -10,7 +10,7 @@
//
// UNSUPPORTED: c++98, c++03, c++11, c++14
-// template
// OutputIterator transform_exclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result, T init,
@@ -64,11 +64,11 @@ test()
{
int ia[] = { 1, 3, 5, 7, 9};
const int pResI0[] = { 0, 1, 4, 9, 16}; // with identity
- const int mResI0[] = { 0, 0, 0, 0, 0};
+ const int mResI0[] = { 0, 0, 0, 0, 0};
const int pResN0[] = { 0, -1, -4, -9, -16}; // with negate
const int mResN0[] = { 0, 0, 0, 0, 0};
const int pResI2[] = { 2, 3, 6, 11, 18}; // with identity
- const int mResI2[] = { 2, 2, 6, 30, 210};
+ const int mResI2[] = { 2, 2, 6, 30, 210};
const int pResN2[] = { 2, 1, -2, -7, -14}; // with negate
const int mResN2[] = { 2, -2, 6, -30, 210};
const unsigned sa = sizeof(ia) / sizeof(ia[0]);
@@ -149,7 +149,7 @@ void basic_tests()
int main()
{
basic_tests();
-
+
// All the iterator categories
test >();
test >();
diff --git a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
new file mode 100644
index 000000000000..b96218d7da4f
--- /dev/null
+++ b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
@@ -0,0 +1,133 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// template
+// OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
+// OutputIterator result,
+// BinaryOperation binary_op,
+// UnaryOperation unary_op);
+
+
+#include
+#include
+#include
+#include
+
+#include "test_iterators.h"
+
+template
+struct identity : std::unary_function<_Tp, _Tp>
+{
+ constexpr const _Tp& operator()(const _Tp& __x) const { return __x;}
+};
+
+template <>
+struct identity
+{
+ template
+ constexpr auto operator()(_Tp&& __x) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x)))
+ -> decltype (_VSTD::forward<_Tp>(__x))
+ { return _VSTD::forward<_Tp>(__x); }
+};
+
+template
+void
+test(Iter1 first, Iter1 last, BOp bop, UOp uop, Iter2 rFirst, Iter2 rLast)
+{
+ std::vector::value_type> v;
+// Test not in-place
+ std::transform_inclusive_scan(first, last, std::back_inserter(v), bop, uop);
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+
+// Test in-place
+ v.clear();
+ v.assign(first, last);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), bop, uop);
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+}
+
+
+template
+void
+test()
+{
+ int ia[] = { 1, 3, 5, 7, 9};
+ const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity
+ const int mResI0[] = { 1, 3, 15, 105, 945};
+ const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate
+ const int mResN0[] = { -1, 3, -15, 105, -945};
+ const unsigned sa = sizeof(ia) / sizeof(ia[0]);
+ static_assert(sa == sizeof(pResI0) / sizeof(pResI0[0])); // just to be sure
+ static_assert(sa == sizeof(mResI0) / sizeof(mResI0[0])); // just to be sure
+ static_assert(sa == sizeof(pResN0) / sizeof(pResN0[0])); // just to be sure
+ static_assert(sa == sizeof(mResN0) / sizeof(mResN0[0])); // just to be sure
+
+ for (unsigned int i = 0; i < sa; ++i ) {
+ test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), pResI0, pResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), mResI0, mResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), pResN0, pResN0 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), mResN0, mResN0 + i);
+ }
+}
+
+int triangle(int n) { return n*(n+1)/2; }
+
+// Basic sanity
+void basic_tests()
+{
+ {
+ std::vector v(10);
+ std::fill(v.begin(), v.end(), 3);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>());
+ std::copy(v.begin(), v.end(), std::ostream_iterator(std::cout, " "));
+ std::cout << std::endl;
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == (int)(i+1) * 3);
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 0);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>());
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == triangle(i));
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 1);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>());
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == triangle(i + 1));
+ }
+
+ {
+ std::vector v, res;
+ std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), identity<>());
+ assert(res.empty());
+ }
+}
+
+int main()
+{
+ basic_tests();
+
+// All the iterator categories
+ test >();
+ test >();
+ test >();
+ test >();
+ test();
+ test< int*>();
+}
diff --git a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
new file mode 100644
index 000000000000..df68946a5e65
--- /dev/null
+++ b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
@@ -0,0 +1,160 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// template
+// OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
+// OutputIterator result,
+// BinaryOperation binary_op,
+// UnaryOperation unary_op,
+// T init);
+
+
+#include
+#include
+#include
+
+#include "test_iterators.h"
+
+template
+struct identity : std::unary_function<_Tp, _Tp>
+{
+ constexpr const _Tp& operator()(const _Tp& __x) const { return __x;}
+};
+
+template <>
+struct identity
+{
+ template
+ constexpr auto operator()(_Tp&& __x) const
+ _NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x)))
+ -> decltype (_VSTD::forward<_Tp>(__x))
+ { return _VSTD::forward<_Tp>(__x); }
+};
+
+template
+void
+test(Iter1 first, Iter1 last, BOp bop, UOp uop, T init, Iter2 rFirst, Iter2 rLast)
+{
+ std::vector::value_type> v;
+// Test not in-place
+ std::transform_inclusive_scan(first, last, std::back_inserter(v), bop, uop, init);
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+
+// Test in-place
+ v.clear();
+ v.assign(first, last);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), bop, uop, init);
+ assert(std::equal(v.begin(), v.end(), rFirst, rLast));
+}
+
+
+template
+void
+test()
+{
+ int ia[] = { 1, 3, 5, 7, 9};
+ const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity
+ const int mResI0[] = { 0, 0, 0, 0, 0};
+ const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate
+ const int mResN0[] = { 0, 0, 0, 0, 0};
+ const int pResI2[] = { 3, 6, 11, 18, 27}; // with identity
+ const int mResI2[] = { 2, 6, 30, 210, 1890};
+ const int pResN2[] = { 1, -2, -7, -14, -23}; // with negate
+ const int mResN2[] = { -2, 6, -30, 210, -1890};
+ const unsigned sa = sizeof(ia) / sizeof(ia[0]);
+ static_assert(sa == sizeof(pResI0) / sizeof(pResI0[0])); // just to be sure
+ static_assert(sa == sizeof(mResI0) / sizeof(mResI0[0])); // just to be sure
+ static_assert(sa == sizeof(pResN0) / sizeof(pResN0[0])); // just to be sure
+ static_assert(sa == sizeof(mResN0) / sizeof(mResN0[0])); // just to be sure
+ static_assert(sa == sizeof(pResI2) / sizeof(pResI2[0])); // just to be sure
+ static_assert(sa == sizeof(mResI2) / sizeof(mResI2[0])); // just to be sure
+ static_assert(sa == sizeof(pResN2) / sizeof(pResN2[0])); // just to be sure
+ static_assert(sa == sizeof(mResN2) / sizeof(mResN2[0])); // just to be sure
+
+ for (unsigned int i = 0; i < sa; ++i ) {
+ test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 0, pResI0, pResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 0, mResI0, mResI0 + i);
+ test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 0, pResN0, pResN0 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 0, mResN0, mResN0 + i);
+ test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 2, pResI2, pResI2 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 2, mResI2, mResI2 + i);
+ test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 2, pResN2, pResN2 + i);
+ test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 2, mResN2, mResN2 + i);
+ }
+}
+
+int triangle(int n) { return n*(n+1)/2; }
+
+// Basic sanity
+void basic_tests()
+{
+ {
+ std::vector v(10);
+ std::fill(v.begin(), v.end(), 3);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>(), 50);
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == 50 + (int) (i + 1) * 3);
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 0);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>(), 30);
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == 30 + triangle(i));
+ }
+
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 1);
+ std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>(), 40);
+ for (size_t i = 0; i < v.size(); ++i)
+ assert(v[i] == 40 + triangle(i + 1));
+ }
+
+ {
+ std::vector v, res;
+ std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), identity<>(), 1);
+ assert(res.empty());
+ }
+
+// Make sure that the calculations are done using the init typedef
+ {
+ std::vector v(10);
+ std::iota(v.begin(), v.end(), 1);
+ std::vector res;
+ std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), identity<>(), 1);
+
+ assert(res.size() == 10);
+ int j = 1;
+ assert(res[0] == 1);
+ for (size_t i = 1; i < res.size(); ++i)
+ {
+ j *= i + 1;
+ assert(res[i] == j);
+ }
+ }
+}
+
+int main()
+{
+ basic_tests();
+
+// All the iterator categories
+ test >();
+ test >();
+ test >();
+ test >();
+ test();
+ test< int*>();
+}
diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp
index c283f3e29722..b05792ddeb55 100644
--- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp
@@ -14,8 +14,8 @@
// class BinaryOperation, class UnaryOperation>
// T transform_reduce(InputIterator1 first1, InputIterator1 last1,
// T init, BinaryOperation binary_op, UnaryOperation unary_op);
-//
-
+//
+
#include
#include
@@ -58,7 +58,7 @@ template
void
test(Iter1 first1, Iter1 last1, T init, BOp bOp, UOp uOp, T x)
{
- static_assert( std::is_same_v );
assert(std::transform_reduce(first1, last1, init, bOp, uOp) == x);
}
@@ -93,7 +93,7 @@ template
void test_return_type()
{
T *p = nullptr;
- static_assert( std::is_same_v(), identity<>()))> );
}
diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp
index f36b7d49410b..4f8142afe84a 100644
--- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp
@@ -24,7 +24,7 @@ template
void
test(Iter1 first1, Iter1 last1, Iter2 first2, T init, T x)
{
- static_assert( std::is_same_v );
assert(std::transform_reduce(first1, last1, first2, init) == x);
}
@@ -52,7 +52,7 @@ template
void test_return_type()
{
T *p = nullptr;
- static_assert( std::is_same_v );
}
diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp
index b1b53293b991..41ea3b38a7f6 100644
--- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp
+++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp
@@ -15,8 +15,8 @@
// T transform_reduce(InputIterator1 first1, InputIterator1 last1,
// InputIterator2 first2, T init,
// BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
-//
-
+//
+
#include
#include
@@ -26,7 +26,7 @@ template
void
test(Iter1 first1, Iter1 last1, Iter2 first2, T init, Op1 op1, Op2 op2, T x)
{
- static_assert( std::is_same_v );
assert(std::transform_reduce(first1, last1, first2, init, op1, op2) == x);
}
@@ -54,7 +54,7 @@ template
void test_return_type()
{
T *p = nullptr;
- static_assert( std::is_same_v(), std::multiplies<>()))> );
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
index 2aa19c6188a5..f18ed6e2bf0b 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
@@ -111,7 +111,7 @@ int main()
{
static_assert(!std::is_convertible, A2>::value, "");
static_assert(!std::is_convertible<
- std::scoped_allocator_adaptor>,
+ std::scoped_allocator_adaptor>,
std::scoped_allocator_adaptor>>::value, "");
}
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
index 7516b2e3af2b..faf4f11573d1 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
@@ -12,7 +12,7 @@
// class function
// function(const function& f);
-// function(const function&& f);
+// function(function&& f);
#include
#include
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
index 82acdd9d7758..55c2156300fb 100644
--- a/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
@@ -157,7 +157,7 @@ int main()
test(3);
static_assert(constexpr_test(), "" );
static_assert(constexpr_test(3), "" );
-
+
{
optional o(42);
optional o2(std::move(o));
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp
index d7b184f6383c..b4fd2e26425a 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp
@@ -16,7 +16,7 @@
// ~tuple();
// C++17 added:
-// The destructor of tuple shall be a trivial destructor
+// The destructor of tuple shall be a trivial destructor
// if (is_trivially_destructible_v && ...) is true.
#include
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
index aadbf3d5a369..03fb78caa08e 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
@@ -64,18 +64,22 @@ void test_decomp_tuple() {
void test_decomp_pair() {
typedef std::pair T;
{
- T s{99, 42.1};
+ T s{99, 42.5};
auto [m1, m2] = s;
auto& [r1, r2] = s;
assert(m1 == 99);
+ assert(m2 == 42.5);
assert(&r1 == &std::get<0>(s));
+ assert(&r2 == &std::get<1>(s));
}
{
- T const s{99, 42.1};
+ T const s{99, 42.5};
auto [m1, m2] = s;
auto& [r1, r2] = s;
assert(m1 == 99);
+ assert(m2 == 42.5);
assert(&r1 == &std::get<0>(s));
+ assert(&r2 == &std::get<1>(s));
}
}
@@ -86,14 +90,22 @@ void test_decomp_array() {
auto [m1, m2, m3] = s;
auto& [r1, r2, r3] = s;
assert(m1 == 99);
+ assert(m2 == 42);
+ assert(m3 == -1);
assert(&r1 == &std::get<0>(s));
+ assert(&r2 == &std::get<1>(s));
+ assert(&r3 == &std::get<2>(s));
}
{
T const s{{99, 42, -1}};
auto [m1, m2, m3] = s;
auto& [r1, r2, r3] = s;
assert(m1 == 99);
+ assert(m2 == 42);
+ assert(m3 == -1);
assert(&r1 == &std::get<0>(s));
+ assert(&r2 == &std::get<1>(s));
+ assert(&r3 == &std::get<2>(s));
}
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp
index 83c55e75b4d2..b25099f4d2e8 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp
@@ -16,7 +16,7 @@
// ~pair()
// C++17 added:
-// The destructor of pair shall be a trivial destructor
+// The destructor of pair shall be a trivial destructor
// if (is_trivially_destructible_v && is_trivially_destructible_v) is true.
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
index d33ea0bd3f4e..3f7cd4f0b6d2 100644
--- a/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
@@ -37,6 +37,9 @@ struct NoThrowT {
NoThrowT(int) noexcept(true) {}
};
+struct AnyConstructible { template AnyConstructible(T&&) {} };
+struct NoConstructible { NoConstructible() = delete; };
+
void test_T_ctor_noexcept() {
{
using V = std::variant;
@@ -62,6 +65,17 @@ void test_T_ctor_sfinae() {
static_assert(!std::is_constructible::value,
"no matching constructor");
}
+ {
+ using V = std::variant;
+ static_assert(
+ !std::is_constructible>::value,
+ "no matching constructor");
+ static_assert(!std::is_constructible>::value,
+ "no matching constructor");
+ }
+
+
+
#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
{
using V = std::variant;
diff --git a/test/support/count_new.hpp b/test/support/count_new.hpp
index 1b05fe35e948..c001c0340fa2 100644
--- a/test/support/count_new.hpp
+++ b/test/support/count_new.hpp
@@ -231,12 +231,17 @@ class MemCounter
const bool MemCounter::disable_checking = false;
#endif
-MemCounter globalMemCounter((MemCounter::MemCounterCtorArg_()));
+inline MemCounter* getGlobalMemCounter() {
+ static MemCounter counter((MemCounter::MemCounterCtorArg_()));
+ return &counter;
+}
+
+MemCounter &globalMemCounter = *getGlobalMemCounter();
#ifndef DISABLE_NEW_COUNT
void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
- globalMemCounter.newCalled(s);
+ getGlobalMemCounter()->newCalled(s);
void* ret = std::malloc(s);
if (ret == nullptr)
detail::throw_bad_alloc_helper();
@@ -245,21 +250,21 @@ void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
void operator delete(void* p) TEST_NOEXCEPT
{
- globalMemCounter.deleteCalled(p);
+ getGlobalMemCounter()->deleteCalled(p);
std::free(p);
}
void* operator new[](std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
- globalMemCounter.newArrayCalled(s);
+ getGlobalMemCounter()->newArrayCalled(s);
return operator new(s);
}
void operator delete[](void* p) TEST_NOEXCEPT
{
- globalMemCounter.deleteArrayCalled(p);
+ getGlobalMemCounter()->deleteArrayCalled(p);
operator delete(p);
}
diff --git a/test/support/experimental_any_helpers.h b/test/support/experimental_any_helpers.h
index 50bd6d68fba5..9c906e6bf76a 100644
--- a/test/support/experimental_any_helpers.h
+++ b/test/support/experimental_any_helpers.h
@@ -55,6 +55,7 @@ void assertEmpty(std::experimental::any const& a) {
// Assert that an 'any' object stores the specified 'Type' and 'value'.
template
+_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
void assertContains(std::experimental::any const& a, int value = 1) {
assert(!a.empty());
RTTI_ASSERT(a.type() == typeid(Type));
@@ -64,6 +65,7 @@ void assertContains(std::experimental::any const& a, int value = 1) {
// Modify the value of a "test type" stored within an any to the specified
// 'value'.
template
+_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
void modifyValue(std::experimental::any& a, int value) {
assert(!a.empty());
RTTI_ASSERT(a.type() == typeid(Type));
diff --git a/www/upcoming_meeting.html b/www/upcoming_meeting.html
index 90a192828e57..839eea825c5c 100644
--- a/www/upcoming_meeting.html
+++ b/www/upcoming_meeting.html
@@ -36,7 +36,7 @@
This is a temporary page; please check the c++1z status here
- This page shows the status of the papers and issues that are expected to be adopted in Issaquah.
+ This page shows the status of the papers and issues that are expected to be adopted in Toronto.
The groups that have contributed papers:
@@ -45,7 +45,7 @@
- SG1 - Study group #1 (Concurrency working group)
-
+
Paper Status
Paper # | Group | Paper Name | Meeting | Status | First released version |
@@ -59,71 +59,41 @@
Issue # | Issue Name | Meeting | Status |
- 2260 | Missing requirement for Allocator::pointer | Kona | |
- 2768 | any_cast and move semantics | Kona | |
- 2769 | Redundant const in the return type of any_cast(const any&) | Kona | |
- 2781 | Contradictory requirements for std::function and std::reference_wrapper | Kona | |
- 2782 | scoped_allocator_adaptor constructors must be constrained | Kona | |
- 2784 | Resolution to LWG 2484 is missing "otherwise, no effects" and is hard to parse | Kona | Patch Ready |
- 2785 | quoted should work with basic_string_view | Kona | We do this already |
- 2786 | Annex C should mention shared_ptr changes for array support | Kona | Nothing to do |
- 2787 | §[file_status.cons] doesn't match class definition | Kona | |
- 2789 | Equivalence of contained objects | Kona | |
- 2794 | Missing requirements for allocator pointers | Kona | |
- 2795 | §[global.functions] provides incorrect example of ADL use | Kona | Nothing to do |
- 2804 | Unconditional constexpr default constructor for istream_iterator | Kona | We do this already |
- 2812 | Range access is available with <string_view> | Kona | We do this already |
- 2824 | list::sort should say that the order of elements is unspecified if an exception is thrown | Kona | |
- 2826 | string_view iterators use old wording | Kona | Nothing to do |
- 2834 | Resolution LWG 2223 is missing wording about end iterators | Kona | Nothing to do |
- 2835 | LWG 2536 seems to misspecify <tgmath.h> | Kona | |
- 2837 | gcd and lcm should support a wider range of input values | Kona | We do this already |
- 2838 | is_literal_type specification needs a little cleanup | Kona | Nothing to do |
- 2842 | in_place_t check for optional::optional(U&&) should decay U | Kona | |
- 2850 | std::function move constructor does unnecessary work | Kona | |
- 2853 | Possible inconsistency in specification of erase in [vector.modifiers] | Kona | |
- 2855 | std::throw_with_nested("string_literal") | Kona | |
+ 2444 | Inconsistent complexity for std::sort_heap | Toronto | |
+ 2593 | Moved-from state of Allocators | Toronto | |
+ 2597 | std::log misspecified for complex numbers | Toronto | |
+ 2783 | stack::emplace() and queue::emplace() should return decltype(auto) | Toronto | |
+ 2932 | Constraints on parallel algorithm implementations are underspecified | Toronto | |
+ 2937 | Is equivalent("existing_thing", "not_existing_thing") an error? | Toronto | |
+ 2940 | result_of specification also needs a little cleanup | Toronto | |
+ 2942 | LWG 2873's resolution missed weak_ptr::owner_before | Toronto | |
+ 2954 | Specialization of the convenience variable templates should be prohibited | Toronto | |
+ 2961 | Bad postcondition for set_default_resource | Toronto | |
+ 2966 | Incomplete resolution of US 74 | Toronto | |
+ 2974 | Diagnose out of bounds tuple_element/variant_alternative | Toronto | |
| Priority 1 Bugs | | |
2665 | remove_filename() post condition is incorrect | Kona | We do this already |
- 2806 | Base class of bad_optional_access | Kona | We do this already |
- 2857 | {variant,optional,any}::emplace should return the constructed value | Kona | |
Comments about the issues
-- 2260 - Check our current allocators to make sure we do this
-- 2768 - Resolution is "apply 2769"
-- 2769 - This should be easy; trick will be devising tests.
-- 2781 -
-- 2782 - Looks straightforward.
-- 2784 - Patch Ready
-- 2785 - We do this already.
-- 2786 - Nothing to do; just moving words around
-- 2787 - Eric?
-- 2789 - I don't think there are any code changes required here
-- 2794 - I don't think there are any code changes required here - maybe a static_assert.
-- 2795 - Nothing to do; just moving words around
-- 2804 - We do this already.
-- 2812 - We do this already.
-- 2824 - Nothing do to here, but we should add some throwing sort tests.
-- 2826 - Nothing to do; just moving words around
-- 2834 - Nothing to do; just moving words around
-- 2835 - I'm pretty sure we already do this.
-- 2837 - Added some tests to ensure we do this already.
-- 2838 - Nothing to do; just moving words around
-- 2842 - This should be easy; trick will be devising tests.
-- 2850 - I think we already do this.
-- 2853 - I think that this will be mostly adding tests.
-- 2855 - This should be easy; trick will be devising tests.
-
-- 2665 - We do this already.
-- 2806 - We do this already.
-- 2857 - This is the subject of several NB comments.
+- 2444 -
+- 2593 -
+- 2597 - I think we do this already; probably needs tests
+- 2783 - should be easy to change; needs tests
+- 2932 - We're not doing the parallel algorithms yet.
+- 2937 - file system; Eric?
+- 2940 - We haven't implemented result_of yet, but I don't think that this will require any changes.
+- 2942 - all of our owner_before overloads are already noexcept; just need to update the tests.
+- 2954 - I don't think there's anything to do here.
+- 2961 - We haven't implemented the PMR stuff yet.
+- 2966 - Wording cleanup; no code or test changes needed.
+- 2974 - I have some code lying around that does this.
-Last Updated: 7-Feb-2017
+Last Updated: 25-Jun-2017