[libcxx-commits] [PATCH] D143914: [libc++] Clean up pair's constructors and assignment operators

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 13 07:23:59 PST 2023


ldionne created this revision.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This patch makes std::pair's constructors and assignment operators
closer to conforming in C++23. The only missing bit I am aware of
now is `reference_constructs_from_temporary_v` checks, which we
don't have the tools for yet.

This patch removes a long-standing non-standard extension where we'd
provide constructors for tuple-like types in all standard modes. The
criteria for being a tuple-like type are different from pair-like types
as introduced recently in the standard, leading to a lot of complexity
when trying to implement recent papers that touch the pair constructors.

This is technically a source break. However, we did the same removal
for tuple some years ago and didn't run into any major issues (despite
seeing a couple of breaks). I do expect that will cause a bit of breakage,
but at this point it is necessary to disentangle pair's constructors
and avoid introducing behavior that would be subtly inconsistent between
standard versions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143914

Files:
  libcxx/docs/ReleaseNotes.rst
  libcxx/include/__tuple_dir/sfinae_helpers.h
  libcxx/include/__utility/pair.h
  libcxx/include/utility
  libcxx/test/std/utilities/utility/pairs/pairs.pair/assign.pair_like_rv.pass.cpp
  libcxx/test/std/utilities/utility/pairs/pairs.pair/assign.pair_like_rv_const.pass.cpp
  libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_like.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143914.496972.patch
Type: text/x-patch
Size: 25336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230213/dac94559/attachment-0001.bin>


More information about the libcxx-commits mailing list