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
6 changes: 3 additions & 3 deletions stl/inc/xmemory
Original file line number Diff line number Diff line change
Expand Up @@ -2140,10 +2140,10 @@ template <class _Ty, class _Alloc, class _Uty1, class _Uty2, enable_if_t<_Is_spe
_NODISCARD constexpr auto uses_allocator_construction_args(const _Alloc& _Al, pair<_Uty1, _Uty2>&& _Pair) noexcept {
// equivalent to
// return _STD uses_allocator_construction_args<_Ty>(_Al, piecewise_construct,
// _STD forward_as_tuple(_STD move(_Pair).first), _STD forward_as_tuple(_STD move(_Pair).second));
// _STD forward_as_tuple(_STD get<0>(_STD move(_Pair)), _STD forward_as_tuple(_STD get<1>(_STD move(_Pair)));
return _STD make_tuple(piecewise_construct,
_STD uses_allocator_construction_args<typename _Ty::first_type>(_Al, _STD move(_Pair).first),
_STD uses_allocator_construction_args<typename _Ty::second_type>(_Al, _STD move(_Pair).second));
_STD uses_allocator_construction_args<typename _Ty::first_type>(_Al, _STD get<0>(_STD move(_Pair))),
_STD uses_allocator_construction_args<typename _Ty::second_type>(_Al, _STD get<1>(_STD move(_Pair))));
}

template <class _Ty, class _Alloc, class... _Types>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ void test_GH_2021() { // COMPILE-ONLY
tags[0];
}

struct MoveOnlyType {
MoveOnlyType() = default;
MoveOnlyType(MoveOnlyType&&) = default;
};

void test_LWG3527() { // COMPILE-ONLY
allocator<MoveOnlyType> alloc;
MoveOnlyType obj;
pair<MoveOnlyType&&, MoveOnlyType&&> p{move(obj), move(obj)};
[[maybe_unused]] auto t = uses_allocator_construction_args<pair<MoveOnlyType&&, MoveOnlyType&&>>(alloc, move(p));
}

int main() {
test_P0475R1();

Expand Down