From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 8372B3943427 for ; Wed, 28 Apr 2021 17:19:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8372B3943427 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-588-1FOTV7WkNqmriuZZszujUw-1; Wed, 28 Apr 2021 13:19:09 -0400 X-MC-Unique: 1FOTV7WkNqmriuZZszujUw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08BFC18B6146; Wed, 28 Apr 2021 17:19:09 +0000 (UTC) Received: from localhost (unknown [10.33.36.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B839177F8; Wed, 28 Apr 2021 17:19:08 +0000 (UTC) Date: Wed, 28 Apr 2021 18:19:07 +0100 From: Jonathan Wakely To: Ville Voutilainen Cc: libstdc++ , gcc-patches@gcc.gnu.org Subject: Re: [RFC] Deprecate non-standard constructors in std::pair Message-ID: <20210428171907.GW3008@redhat.com> References: <20210407123050.GY3008@redhat.com> <20210407124654.GZ3008@redhat.com> <20210407165922.GA3008@redhat.com> <20210407171845.GB3008@redhat.com> <20210428165757.GT3008@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210428165757.GT3008@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="scYsJfBjqkrBfg1Z" Content-Disposition: inline X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 17:19:22 -0000 --scYsJfBjqkrBfg1Z Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline 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++ >>>>> 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. --scYsJfBjqkrBfg1Z Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit c8767ee9f9355a63bfeb8318df32bc39c5b0f3ad Author: Jonathan Wakely 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 + +// C++20 20.4.2 [pairs.pair] +// pair is a structural type (13.2) if T and U are both structural types. + +template> struct S; // PR libstdc++/97930 --scYsJfBjqkrBfg1Z--