From patchwork Fri Sep 17 19:45:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 45143 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E0EAC385840D for ; Fri, 17 Sep 2021 19:47:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0EAC385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1631908047; bh=slexM22VQxVlVa7W+2AnvprJh2a0y+Jwmcoze2hm+W8=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=F5Gr+IIK+wvTme76pfGPM3V9CkMv8b0eoJlKCbgdrHHpRWOj4dcH0gmr7sRJUAwQ3 ryj2rsMC/5ao4wB55BKwA6JHsofKr4a1ppURzy3ifsKBOt2mm8419XL7VhBKYhOlWL KysjQ7eorgwU8+h2VA6y9OujNnsrNOiHmWrOuvvM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 602AD385700B for ; Fri, 17 Sep 2021 19:45:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 602AD385700B 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-10-ocqs_c04PIK9JwaVE3t8gw-1; Fri, 17 Sep 2021 15:45:49 -0400 X-MC-Unique: ocqs_c04PIK9JwaVE3t8gw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E88671006AAA; Fri, 17 Sep 2021 19:45:48 +0000 (UTC) Received: from localhost (unknown [10.33.36.240]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83CFB60877; Fri, 17 Sep 2021 19:45:48 +0000 (UTC) Date: Fri, 17 Sep 2021 20:45:47 +0100 To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix last std::tuple constructor missing 'constexpr' [PR102270] Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, URI_HEX autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Also rename the test so it actually runs. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102270 * include/std/tuple (_Tuple_impl): Add constexpr to constructor missed in previous patch. * testsuite/20_util/tuple/cons/102270.C: Moved to... * testsuite/20_util/tuple/cons/102270.cc: ...here. * testsuite/util/testsuite_allocator.h (SimpleAllocator): Add constexpr to constructor so it can be used for C++20 tests. Tested powerpc64le-linux. Committed to trunk. git mailpatch 42eff613d0c10f88dc7a44b14981876401a09981 commit 1fa2c5a695bb962ffcf8abed49f69cdcc59d0e61 Author: Jonathan Wakely Date: Fri Sep 17 12:27:02 2021 libstdc++: Fix last std::tuple constructor missing 'constexpr' [PR102270] Also rename the test so it actually runs. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/102270 * include/std/tuple (_Tuple_impl): Add constexpr to constructor missed in previous patch. * testsuite/20_util/tuple/cons/102270.C: Moved to... * testsuite/20_util/tuple/cons/102270.cc: ...here. * testsuite/util/testsuite_allocator.h (SimpleAllocator): Add constexpr to constructor so it can be used for C++20 tests. diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 6f0dc6346e1..120c80a2b78 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -330,6 +330,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { } template + _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Head& __head, const _Tail&... __tail) : _Inherited(__tag, __a, __tail...), diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/102270.C b/libstdc++-v3/testsuite/20_util/tuple/cons/102270.cc similarity index 95% rename from libstdc++-v3/testsuite/20_util/tuple/cons/102270.C rename to libstdc++-v3/testsuite/20_util/tuple/cons/102270.cc index 998329817c7..5500cacab6d 100644 --- a/libstdc++-v3/testsuite/20_util/tuple/cons/102270.C +++ b/libstdc++-v3/testsuite/20_util/tuple/cons/102270.cc @@ -56,6 +56,9 @@ constexpr bool construct_using_allocator() std::tuple t1a1b(std::allocator_arg, a, 1, i, 1, i); + const int c = 0; + std::tuple tii(std::allocator_arg, a, c, c); + return true; } static_assert( construct_using_allocator() ); diff --git a/libstdc++-v3/testsuite/util/testsuite_allocator.h b/libstdc++-v3/testsuite/util/testsuite_allocator.h index 1f7912ea6eb..b5b402858a6 100644 --- a/libstdc++-v3/testsuite/util/testsuite_allocator.h +++ b/libstdc++-v3/testsuite/util/testsuite_allocator.h @@ -514,7 +514,7 @@ namespace __gnu_test { typedef Tp value_type; - SimpleAllocator() noexcept { } + constexpr SimpleAllocator() noexcept { } template SimpleAllocator(const SimpleAllocator&) { }