On 28/04/21 17:57 +0100, Jonathan Wakely wrote:
On 07/04/21 18:18 +0100, Jonathan Wakely wrote:
On 07/04/21 17:59 +0100, Jonathan Wakely wrote:
On 07/04/21 13:46 +0100, Jonathan Wakely wrote:
On 07/04/21 15:41 +0300, Ville Voutilainen via Libstdc++ wrote:
On Wed, 7 Apr 2021 at 15:31, Jonathan Wakely via Libstdc++
<libstd...@gcc.gnu.org> wrote:
I propose that we deprecate the constructors for C++11/14/17/20 in
stage 1, and do not support them at all in C++23 mode once P1951 is
supported. I have a patch which I'll send in stage 1 (it also uses
C++20 concepts to simplify std::pair and fix PR 97930).

After a period of deprecation we could remove them, and support P1951
for -std=gnu++11/14/17/20 too so that {} continues to work.

The proposal sounds good to me.

Thanks. I've created https://gcc.gnu.org/PR99957 so I don't forget.

Here's a patch to implement it, for stage 1.

And here's a patch to simplify the std::pair constraints using
concepts, also for consideration in stage 1.

I've pushed this to trunk too, after testing on powerpc64le-linux.

And this adds a testcase to verify that the simplified version using
concepts actually fixes PR 97930, as claimed above.

Tested x86_64- linux, pushed to trunk.


commit c8767ee9f9355a63bfeb8318df32bc39c5b0f3ad
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Apr 28 18:14:05 2021

    libstdc++: Add testcase for std::pair as a structural type [PR 97930]
    
    This PR was fixed by r12-221-ge1543e694dadf1ea70eb72325219bc0cdc914a35
    (for compilers that support C++20 Concepts) so this adds the testcase.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/97930
            * testsuite/20_util/pair/requirements/structural.cc: New test.

diff --git a/libstdc++-v3/testsuite/20_util/pair/requirements/structural.cc b/libstdc++-v3/testsuite/20_util/pair/requirements/structural.cc
new file mode 100644
index 00000000000..d4df20197ee
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/pair/requirements/structural.cc
@@ -0,0 +1,9 @@
+// { dg-options "-std=gnu++20" }
+// { dg-do compile { target c++20 } }
+
+#include <utility>
+
+// C++20 20.4.2 [pairs.pair]
+// pair<T, U> is a structural type (13.2) if T and U are both structural types.
+
+template<std::pair<int, int>> struct S; // PR libstdc++/97930

Reply via email to