libstdc++: Simplify std::pair constraints using concepts
authorJonathan Wakely <jwakely@redhat.com>
Wed, 28 Apr 2021 16:46:01 +0000 (17:46 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 28 Apr 2021 16:56:51 +0000 (17:56 +0100)
commite1543e694dadf1ea70eb72325219bc0cdc914a35
tree36e3876b1d3f5e82b548f7906df902ee1198d902
parentd96db15967e78d7cecea3b1cf3169ceb924678ac
libstdc++: Simplify std::pair constraints using concepts

This re-implements the constraints on the std::pair constructors and
assignment operators in C++20 mode, to use concepts.

The non-standard constructors deprecated for PR 99957 are no longer
supported in C++20 mode, which requires some minor testsuite changes.
Otherwise all tests pass in C++20 mode.

libstdc++-v3/ChangeLog:

* include/bits/stl_pair.h (pair) [__cplusplus > 202002]: Add
new definitions for constructors and assignment operators using
concepts for constraints.
* testsuite/20_util/pair/cons/99957.cc: Disable for C++20 and
later.
* testsuite/20_util/pair/cons/explicit_construct.cc: Adjust
expected error messages to also match C++20 errors.
libstdc++-v3/include/bits/stl_pair.h
libstdc++-v3/testsuite/20_util/pair/cons/99957.cc
libstdc++-v3/testsuite/20_util/pair/cons/explicit_construct.cc