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 ESMTPS id 309033858C5F for ; Fri, 1 Mar 2024 15:09:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 309033858C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 309033858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709305762; cv=none; b=netyTW9zQa6QZdbnXauy28nzYgZf50RftlRsxmLcrcTxTXjnHyKaB0CypgBjLodRMFQT0X2yoYscf2UsbA9thBN88SNlfWVvtOmcYY0aEYOpTj3mWZWlkaPKd3JdxEZAgmx/ajefHH/BqnoYko979fOBgLvsHIk3xZWfn2bCs8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709305762; c=relaxed/simple; bh=fIp4frHpct5bdu29FC2mwv+1XApPX/sxmubeuJI4QRY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QLn3tn2uKvhW4AvWR6qrDtDYcwfdvle5YZo7hJLmVcZshU6vZw0q3rQLh9c4MTdUYm+4EorIYw8kILQ2/xdGsTJKj0ZM4n3hKAEawdWo+/z3J+Sp5WHQpdhVuAdgyHhtr8lVaDwlEEgM3srIhnPxfqh0oVHUd/uP4uqc9i05PCc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709305757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CEoQNwO/3wseXq9iRTgwLApH0X/2ZV9T3Hz0eKcV/zk=; b=CDESBg1KVzfFlbrVzRH7mPxd/MLYmN8fWCRflL6fv97uEdmu5tBaXAmnKD2VidUn9RrwM2 TnBQ3ZLlTZNKoNoPSQskkuqdHbjTgfhkhmQDlsoep2GNaWsZLCLfzoYLL5DgWB2bJuVqR2 krxzLePys1L50P29vAm3zT+lbnpOnTU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-288-CKPDTCZRPNOWz0Xfql7afA-1; Fri, 01 Mar 2024 10:09:16 -0500 X-MC-Unique: CKPDTCZRPNOWz0Xfql7afA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0602811BB5EA; Fri, 1 Mar 2024 15:09:16 +0000 (UTC) Received: from localhost (unknown [10.42.28.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id C291420229A4; Fri, 1 Mar 2024 15:09:15 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Ville Voutilainen , Patrick Palka Subject: [PATCH] libstdc++: Add missing std::tuple constructor [PR114147] Date: Fri, 1 Mar 2024 14:23:32 +0000 Message-ID: <20240301150915.92103-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 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_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,URI_HEX autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This fixes a regression on all active branches. Tested aarch64-linux. -- >8 -- I caused a regression with commit r10-908 by adding a constraint to the non-explicit allocator-extended default constructor, but seemingly forgot to add an explicit overload with the corresponding constraint. libstdc++-v3/ChangeLog: PR libstdc++/114147 * include/std/tuple (tuple::tuple(allocator_arg_t, const Alloc&)): Add missing overload of allocator-extended default constructor. (tuple::tuple(allocator_arg_t, const Alloc&)): Likewise. * testsuite/20_util/tuple/cons/114147.cc: New test. --- libstdc++-v3/include/std/tuple | 14 ++++++++++++++ .../testsuite/20_util/tuple/cons/114147.cc | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 libstdc++-v3/testsuite/20_util/tuple/cons/114147.cc diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 9c89c13ab84..3065058e184 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -1550,6 +1550,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION tuple(allocator_arg_t __tag, const _Alloc& __a) : _Inherited(__tag, __a) { } + template::value> = false> + _GLIBCXX20_CONSTEXPR + explicit + tuple(allocator_arg_t __tag, const _Alloc& __a) + : _Inherited(__tag, __a) { } + template= 1), _ImplicitCtor<_NotEmpty, const _Elements&...> = true> _GLIBCXX20_CONSTEXPR @@ -2198,6 +2205,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION tuple(allocator_arg_t __tag, const _Alloc& __a) : _Inherited(__tag, __a) { } + template::value, _T1, _T2> = false> + _GLIBCXX20_CONSTEXPR + explicit + tuple(allocator_arg_t __tag, const _Alloc& __a) + : _Inherited(__tag, __a) { } + template = true> _GLIBCXX20_CONSTEXPR diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/114147.cc b/libstdc++-v3/testsuite/20_util/tuple/cons/114147.cc new file mode 100644 index 00000000000..916e7204964 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/cons/114147.cc @@ -0,0 +1,15 @@ +// { dg-do compile { target c++11 } } + +// PR libstdc++/114147 +// tuple allocator-extended ctor requires non-explicit default ctor + +#include +#include + +struct X { explicit X(); }; + +std::allocator a; +std::tuple t0(std::allocator_arg, a); +std::tuple t1(std::allocator_arg, a); +std::tuple t2(std::allocator_arg, a); +std::tuple t3(std::allocator_arg, a); -- 2.43.2