[all-commits] [llvm/llvm-project] 9e35fc: [libc++] Clean up pair's constructors and assignme...

Louis Dionne via All-commits all-commits at lists.llvm.org
Fri Apr 28 12:16:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e35fc07f4001c5803069013bcfc266ad99da637
      https://github.com/llvm/llvm-project/commit/9e35fc07f4001c5803069013bcfc266ad99da637
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2023-04-28 (Fri, 28 Apr 2023)

  Changed paths:
    M libcxx/include/__tuple/sfinae_helpers.h
    M libcxx/include/__utility/pair.h
    M libcxx/include/utility
    A libcxx/test/std/utilities/utility/pairs/pairs.pair/assign.pair_like_rv.pass.cpp
    A libcxx/test/std/utilities/utility/pairs/pairs.pair/assign.pair_like_rv_const.pass.cpp
    A libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.pair_like.pass.cpp

  Log Message:
  -----------
  [libc++] Clean up pair's constructors and assignment operators

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 also refactors 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.

After this patch, the pre-C++23 extension is provided in a self-contained
block so that we can easily deprecate and eventually remove the extension
in future releases.

Differential Revision: https://reviews.llvm.org/D143914




More information about the All-commits mailing list