This patch implements the C++2a proposal to allow incomplete types in std::reference_wrapper, which was previously undefined. The change cannot be implemented for earlier standards, because prior to C++2a std::reference_wrapper has a weak result type, so must inspect the template argument to see if it defines a nested result_type member. That is deprecated (but still required) in C++17, and removed from C++2a. The removal of the base class from reference_wrapper is a potential ABI change, as it could alter the layout of a type which derives from reference_wrapper<T> and from an empty type with _Weak_result_type<T> as a base class. Previously the repeated _Weak_result_type<T> base class would have prevented the empty base-class optimization, but if reference_wrapper<T> no longer derives from it, the empty class could be placed at the same address as the reference_wrapper<T> base. In practice, the only types which derive from _Weak_result_type or from _Reference_wrapper_base_memfun or any of its base classes are non-empty types defined in libstdc++: std::reference_wrapper, std::function, and std::_Bind. As they are non-empty types, they are not eligible for EBO anyway. * include/bits/refwrap.h [__cplusplus > 201703L] (_Refwrap_base_arg1, _Refwrap_base_arg2, _Reference_wrapper_base) (_Reference_wrapper_base_memfun): Do not define for C++2a. (reference_wrapper): Do not derive from _Reference_wrapper_base_memfun for C++2a. (reference_wrapper::operator()): Add static assertion. * testsuite/20_util/reference_wrapper/incomplete.cc: New test. From-SVN: r267866
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| add_const | Loading commit data... | |
| add_cv | Loading commit data... | |
| add_lvalue_reference | Loading commit data... | |
| add_pointer | Loading commit data... | |
| add_rvalue_reference | Loading commit data... | |
| add_volatile | Loading commit data... | |
| addressof | Loading commit data... | |
| align | Loading commit data... | |
| aligned_storage | Loading commit data... | |
| aligned_union | Loading commit data... | |
| alignment_of | Loading commit data... | |
| allocator | Loading commit data... | |
| allocator_traits | Loading commit data... | |
| any | Loading commit data... | |
| as_const | Loading commit data... | |
| assume_aligned | Loading commit data... | |
| auto_ptr | Loading commit data... | |
| bad_function_call | Loading commit data... | |
| bind | Loading commit data... | |
| bool_constant | Loading commit data... | |
| common_type/requirements | Loading commit data... | |
| conditional/requirements | Loading commit data... | |
| decay/requirements | Loading commit data... | |
| declval/requirements | Loading commit data... | |
| default_delete | Loading commit data... | |
| duration | Loading commit data... | |
| duration_cast | Loading commit data... | |
| enable_if/requirements | Loading commit data... | |
| enable_shared_from_this | Loading commit data... | |
| endian | Loading commit data... | |
| exchange | Loading commit data... | |
| extent | Loading commit data... | |
| forward | Loading commit data... | |
| from_chars | Loading commit data... | |
| function | Loading commit data... | |
| function_objects | Loading commit data... | |
| has_unique_object_representations | Loading commit data... | |
| has_virtual_destructor | Loading commit data... | |
| hash | Loading commit data... | |
| headers | Loading commit data... | |
| in_place | Loading commit data... | |
| integer_sequence | Loading commit data... | |
| integral_constant | Loading commit data... | |
| is_abstract | Loading commit data... | |
| is_aggregate | Loading commit data... | |
| is_arithmetic | Loading commit data... | |
| is_array | Loading commit data... | |
| is_assignable | Loading commit data... | |
| is_base_of | Loading commit data... | |
| is_class | Loading commit data... | |
| is_compound | Loading commit data... | |
| is_const | Loading commit data... | |
| is_constant_evaluated | Loading commit data... | |
| is_constructible | Loading commit data... | |
| is_convertible | Loading commit data... | |
| is_copy_assignable | Loading commit data... | |
| is_copy_constructible | Loading commit data... | |
| is_default_constructible | Loading commit data... | |
| is_destructible | Loading commit data... | |
| is_empty | Loading commit data... | |
| is_enum | Loading commit data... | |
| is_final | Loading commit data... | |
| is_floating_point | Loading commit data... | |
| is_function | Loading commit data... | |
| is_fundamental | Loading commit data... | |
| is_implicitly_default_constructible | Loading commit data... | |
| is_integral | Loading commit data... | |
| is_invocable | Loading commit data... | |
| is_literal_type | Loading commit data... | |
| is_lvalue_reference | Loading commit data... | |
| is_member_function_pointer | Loading commit data... | |
| is_member_object_pointer | Loading commit data... | |
| is_member_pointer | Loading commit data... | |
| is_move_assignable | Loading commit data... | |
| is_move_constructible | Loading commit data... | |
| is_nothrow_assignable | Loading commit data... | |
| is_nothrow_constructible | Loading commit data... | |
| is_nothrow_convertible | Loading commit data... | |
| is_nothrow_copy_assignable | Loading commit data... | |
| is_nothrow_copy_constructible | Loading commit data... | |
| is_nothrow_default_constructible | Loading commit data... | |
| is_nothrow_destructible | Loading commit data... | |
| is_nothrow_invocable | Loading commit data... | |
| is_nothrow_move_assignable | Loading commit data... | |
| is_nothrow_move_constructible | Loading commit data... | |
| is_nothrow_swappable | Loading commit data... | |
| is_nothrow_swappable_with | Loading commit data... | |
| is_null_pointer | Loading commit data... | |
| is_object | Loading commit data... | |
| is_pod | Loading commit data... | |
| is_pointer | Loading commit data... | |
| is_polymorphic | Loading commit data... | |
| is_reference | Loading commit data... | |
| is_rvalue_reference | Loading commit data... | |
| is_same | Loading commit data... | |
| is_scalar | Loading commit data... | |
| is_signed | Loading commit data... | |
| is_standard_layout | Loading commit data... | |
| is_swappable | Loading commit data... | |
| is_swappable_with | Loading commit data... | |
| is_trivial | Loading commit data... | |
| is_trivially_assignable | Loading commit data... | |
| is_trivially_constructible | Loading commit data... | |
| is_trivially_copy_assignable | Loading commit data... | |
| is_trivially_copy_constructible | Loading commit data... | |
| is_trivially_copyable | Loading commit data... | |
| is_trivially_default_constructible | Loading commit data... | |
| is_trivially_destructible | Loading commit data... | |
| is_trivially_move_assignable | Loading commit data... | |
| is_trivially_move_constructible | Loading commit data... | |
| is_union | Loading commit data... | |
| is_unsigned | Loading commit data... | |
| is_void | Loading commit data... | |
| is_volatile | Loading commit data... | |
| logical_traits | Loading commit data... | |
| make_signed/requirements | Loading commit data... | |
| make_unsigned/requirements | Loading commit data... | |
| memory_resource | Loading commit data... | |
| monotonic_buffer_resource | Loading commit data... | |
| move | Loading commit data... | |
| move_if_noexcept | Loading commit data... | |
| optional | Loading commit data... | |
| owner_less | Loading commit data... | |
| pair | Loading commit data... | |
| pointer_safety | Loading commit data... | |
| pointer_traits | Loading commit data... | |
| polymorphic_allocator | Loading commit data... | |
| rank | Loading commit data... | |
| ratio | Loading commit data... | |
| raw_storage_iterator | Loading commit data... | |
| reference_wrapper | Loading commit data... | |
| remove_all_extents | Loading commit data... | |
| remove_const | Loading commit data... | |
| remove_cv | Loading commit data... | |
| remove_cvref | Loading commit data... | |
| remove_extent | Loading commit data... | |
| remove_pointer | Loading commit data... | |
| remove_reference | Loading commit data... | |
| remove_volatile | Loading commit data... | |
| result_of | Loading commit data... | |
| scoped_allocator | Loading commit data... | |
| shared_ptr | Loading commit data... | |
| specialized_algorithms | Loading commit data... | |
| steady_clock | Loading commit data... | |
| synchronized_pool_resource | Loading commit data... | |
| system_clock | Loading commit data... | |
| time_point | Loading commit data... | |
| time_point_cast | Loading commit data... | |
| to_address | Loading commit data... | |
| to_chars | Loading commit data... | |
| tuple | Loading commit data... | |
| type_identity/requirements | Loading commit data... | |
| typeindex | Loading commit data... | |
| underlying_type/requirements | Loading commit data... | |
| unique_ptr | Loading commit data... | |
| unsynchronized_pool_resource | Loading commit data... | |
| unwrap_reference | Loading commit data... | |
| uses_allocator | Loading commit data... | |
| variant | Loading commit data... | |
| void_t | Loading commit data... | |
| weak_ptr | Loading commit data... | |
| rel_ops.cc | Loading commit data... | |
| temporary_buffer.cc | Loading commit data... | |
| variable_templates_for_traits.cc | Loading commit data... |