Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm-project
Submodule llvm-project updated 4817 files
6 changes: 5 additions & 1 deletion stl/inc/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,11 @@ template <class _Ty, class _Uty>
struct _Refwrap_has_ctor_from<_Ty, _Uty, void_t<decltype(_Refwrap_ctor_fun<_Ty>(_STD declval<_Uty>()))>> : true_type {};

template <class _Ty>
class reference_wrapper : public _Weak_types<_Ty>::type { // stand-in for an assignable reference
class reference_wrapper
#if !_HAS_CXX20
Comment thread
BillyONeal marked this conversation as resolved.
: public _Weak_types<_Ty>::type

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a design question here, because we haven't yet merged #380 to implement #28 (WG21-P0619 Removing C++17-Deprecated Features In C++20). Specifically, an escape hatch to restore reference_wrapper's weak result type is incompatible with supporting incomplete types. There are two possible decisions: allow reference_wrapper to be affected by such an escape hatch (thereby disabling support for incomplete types), or exempt reference_wrapper from the escape hatch (so C++20 mode always activates support for incomplete types).

It's not a big deal because reference_wrapper's support for weak result types is extremely obscure. I am inclined to accept the code as-is, meaning that C++20 mode always makes reference_wrapper support incomplete types and removes its weak result type, even if weak result types have otherwise been escape-hatched.

#endif // !_HAS_CXX20
{
public:
static_assert(is_object_v<_Ty> || is_function_v<_Ty>,
"reference_wrapper<T> requires T to be an object type or a function type.");
Expand Down
1 change: 1 addition & 0 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/libcxx/magic_comments.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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