[libc++] Fix `std::pair`'s pair-like constructor's incorrect assumption (#66585)
authorHui <65944694+huixie90@users.noreply.github.com>
Mon, 18 Sep 2023 18:01:19 +0000 (19:01 +0100)
committerTobias Hieta <tobias@hieta.se>
Tue, 3 Oct 2023 06:29:39 +0000 (08:29 +0200)
commit23988a1d82d51670e100791b8a8745e5d8457d35
tree32666353ff83e17f623a823c49ec5eed0873ef00
parent33e14ecd6aac8c61c055921dd6e564d170fe34d6
[libc++] Fix `std::pair`'s  pair-like constructor's incorrect assumption (#66585)

The helper function `__pair_like_explicit_wknd` is only SFINAE-ed with
`tuple_size<remove_cvref_t<_PairLike>>::value == 2`, but its function
body assumes `std::get` being valid.

Fixes #65620

(cherry picked from commit 054f9c55c6b4520d3feb8b4354b9b942026b5124)
libcxx/include/__utility/pair.h
libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_like.pass.cpp