From 0b0d96db4d4643be9a15d2e4737f2a83a8d62e38 Mon Sep 17 00:00:00 2001 From: Adam Bucior <35536269+AdamBucior@users.noreply.github.com> Date: Tue, 17 Dec 2019 22:25:40 +0100 Subject: [PATCH 1/3] Implement P0357R3 --- stl/inc/type_traits | 6 +++++- stl/inc/yvals_core.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index c94b8592680..93846aeea7d 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1840,7 +1840,11 @@ template struct _Refwrap_has_ctor_from<_Ty, _Uty, void_t(_STD declval<_Uty>()))>> : true_type {}; template -class reference_wrapper : public _Weak_types<_Ty>::type { // stand-in for an assignable reference +class reference_wrapper +#if !_HAS_CXX20 + : public _Weak_types<_Ty>::type +#endif // !_HAS_CXX20 +{ // stand-in for an assignable reference public: static_assert(is_object_v<_Ty> || is_function_v<_Ty>, "reference_wrapper requires T to be an object type or a function type."); diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index aafec2118e6..8018460f371 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -130,6 +130,7 @@ // P0318R1 unwrap_reference, unwrap_ref_decay // P0325R4 to_array() // P0356R5 bind_front() +// P0357R3 Supporting Incomplete Types In reference_wrapper // P0439R0 enum class memory_order // P0457R2 starts_with()/ends_with() For basic_string/basic_string_view // P0458R2 contains() For Ordered And Unordered Associative Containers From b65e367bdf3d392f41c3f5265870df4f42f869ab Mon Sep 17 00:00:00 2001 From: Adam Bucior <35536269+AdamBucior@users.noreply.github.com> Date: Tue, 17 Dec 2019 23:34:32 +0100 Subject: [PATCH 2/3] Remove meaningless comment Co-Authored-By: Casey Carter --- stl/inc/type_traits | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index ea845a65478..93d59e1559d 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1849,7 +1849,7 @@ class reference_wrapper #if !_HAS_CXX20 : public _Weak_types<_Ty>::type #endif // !_HAS_CXX20 -{ // stand-in for an assignable reference +{ public: static_assert(is_object_v<_Ty> || is_function_v<_Ty>, "reference_wrapper requires T to be an object type or a function type."); From a8f0f5b10ad6d152463417328345d7ca1b59e91d Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 8 Jan 2020 16:54:26 -0800 Subject: [PATCH 3/3] Update LLVM to get skip of libcxx\test\std\utilities\function.objects\refwrap\weak_result.pass.cpp, and exclude "// REQUIRES: c++98 || c++03 || c++11 || c++14 || c++17" as a 'magic comment'. --- llvm-project | 2 +- tests/libcxx/magic_comments.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm-project b/llvm-project index 0b969fa9ccf..85ee4ff4e47 160000 --- a/llvm-project +++ b/llvm-project @@ -1 +1 @@ -Subproject commit 0b969fa9ccf595abc31942e5d14be784707e960c +Subproject commit 85ee4ff4e474788abc7abdc939114281c2a68ec1 diff --git a/tests/libcxx/magic_comments.txt b/tests/libcxx/magic_comments.txt index eb038b57412..a905db0a4e7 100644 --- a/tests/libcxx/magic_comments.txt +++ b/tests/libcxx/magic_comments.txt @@ -2,4 +2,5 @@ // REQUIRES: c++11 || c++14 // REQUIRES: c++98 || c++03 // REQUIRES: c++98 || c++03 || c++11 || c++14 +// REQUIRES: c++98 || c++03 || c++11 || c++14 || c++17 // UNSUPPORTED: c++14, c++17, c++2a