From patchwork Thu Jun 20 15:35:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1950254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NaucBfa3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4l4c5LgZz20KL for ; Fri, 21 Jun 2024 01:38:08 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0275A3894C36 for ; Thu, 20 Jun 2024 15:38:07 +0000 (GMT) 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.129.124]) by sourceware.org (Postfix) with ESMTPS id 6564B389366C for ; Thu, 20 Jun 2024 15:36:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6564B389366C 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 6564B389366C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718897800; cv=none; b=LXhBxYosg4V0Z9LhBd1u3sYc13zZyGlkFoAZzWNmXwk6TARE2K2eHKdxR9tAhrR7uL6agySO6CEXAJe6X6CILaDf5im9oXufV/nSYeybSe2eDEkpAHRRjwOY9UlDfliZUwAtZ/NjR6devJ9RPRXYx6xsM+ynVHF45f1GSrMH3ho= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718897800; c=relaxed/simple; bh=Ksx7obg36kQvdRnI4fLadik0c/FsCVlrdNNq2B/sO+w=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vljXEpNi/ktoj2dKh5yU4Fc5SYvc1FKvjh3cv9stxO5JZRLuBYsmPH4EE1dX5q64x8xl/HWxQtasfW/Tk1YlLdThii2J2/DhJde5+sI9jAJGvDGQdVawnz+/mdoIaJOX/vOhladgmN42mQee7Hws2AE2O0jPIU0jIJTVhF98bCo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718897784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I/7ZncQBU6+icOvi2lwkFaRW6vHge7TB9g/R0WtgBaQ=; b=NaucBfa3iQocR0caLj4VGa95O2e8LVh20+bVx5BPxnbz9jeqw12iX/ctEuY+PYzBG0+dgx WjeF/EZEfjOCjj5s1+KvqifCOvLUB/1IJDsROyosuy9GVn+JeedgJFtR+FMws+sPzaLH1/ GyYzdUgMhISJx+tV5S0jWZv+Lf5tNy8= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-_LluqjRKMyCrpDrryScw8A-1; Thu, 20 Jun 2024 11:36:21 -0400 X-MC-Unique: _LluqjRKMyCrpDrryScw8A-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 464E51954214; Thu, 20 Jun 2024 15:36:20 +0000 (UTC) Received: from localhost (unknown [10.42.28.182]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8DDFD195605B; Thu, 20 Jun 2024 15:36:19 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 1/3] libstdc++: Add [[deprecated]] to std::wstring_convert and std::wbuffer_convert Date: Thu, 20 Jun 2024 16:35:52 +0100 Message-ID: <20240620153618.2024734-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 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_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. -- >8 -- These were deprecated in C++17 and std::wstring_convert is planned for removal in C++26. libstdc++-v3/ChangeLog: * include/bits/locale_conv.h (wstring_convert): Add deprecated attribute for C++17 and later. (wbuffer_convert): Likewise. * testsuite/22_locale/codecvt/codecvt_utf16/79980.cc: Disable deprecated warnings. * testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: Likewise. * testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc: Likewise. * testsuite/22_locale/conversions/buffer/1.cc: Add dg-warning. * testsuite/22_locale/conversions/buffer/2.cc: Likewise. * testsuite/22_locale/conversions/buffer/3.cc: Likewise. * testsuite/22_locale/conversions/buffer/requirements/typedefs.cc: Likewise. * testsuite/22_locale/conversions/string/1.cc: Likewise. * testsuite/22_locale/conversions/string/2.cc: Likewise. * testsuite/22_locale/conversions/string/3.cc: Likewise. * testsuite/22_locale/conversions/string/66441.cc: Likewise. * testsuite/22_locale/conversions/string/requirements/typedefs-2.cc: Likewise. * testsuite/22_locale/conversions/string/requirements/typedefs.cc: Likewise. --- libstdc++-v3/include/bits/locale_conv.h | 5 +++-- .../testsuite/22_locale/codecvt/codecvt_utf16/79980.cc | 1 + .../testsuite/22_locale/codecvt/codecvt_utf8/79980.cc | 1 + .../testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc | 1 + libstdc++-v3/testsuite/22_locale/conversions/buffer/1.cc | 1 + libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc | 1 + libstdc++-v3/testsuite/22_locale/conversions/buffer/3.cc | 2 ++ .../22_locale/conversions/buffer/requirements/typedefs.cc | 2 +- libstdc++-v3/testsuite/22_locale/conversions/string/1.cc | 1 + libstdc++-v3/testsuite/22_locale/conversions/string/2.cc | 1 + libstdc++-v3/testsuite/22_locale/conversions/string/3.cc | 1 + libstdc++-v3/testsuite/22_locale/conversions/string/66441.cc | 1 + .../22_locale/conversions/string/requirements/typedefs-2.cc | 1 + .../22_locale/conversions/string/requirements/typedefs.cc | 1 + 14 files changed, 17 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/bits/locale_conv.h b/libstdc++-v3/include/bits/locale_conv.h index 754c36b92b8..63dee1ac872 100644 --- a/libstdc++-v3/include/bits/locale_conv.h +++ b/libstdc++-v3/include/bits/locale_conv.h @@ -259,7 +259,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 template, typename _Byte_alloc = allocator> - class wstring_convert + class _GLIBCXX17_DEPRECATED wstring_convert { public: typedef basic_string, _Byte_alloc> byte_string; @@ -406,7 +406,8 @@ _GLIBCXX_END_NAMESPACE_CXX11 /// Buffer conversions template> - class wbuffer_convert : public basic_streambuf<_Elem, _Tr> + class _GLIBCXX17_DEPRECATED wbuffer_convert + : public basic_streambuf<_Elem, _Tr> { typedef basic_streambuf<_Elem, _Tr> _Wide_streambuf; diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc index 1c6711b56db..90cb844bba3 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc @@ -16,6 +16,7 @@ // . // { dg-do run { target c++11 } } +// { dg-additional-options "-Wno-deprecated-declarations" { target c++17 } } #include #include diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc index d6cd89ce420..66aadc1161d 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc @@ -16,6 +16,7 @@ // . // { dg-do run { target c++11 } } +// { dg-additional-options "-Wno-deprecated-declarations" { target c++17 } } #include #include diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc index d09aa41ee93..e6934818864 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc @@ -16,6 +16,7 @@ // . // { dg-do run { target c++11 } } +// { dg-additional-options "-Wno-deprecated-declarations" { target c++17 } } #include #include diff --git a/libstdc++-v3/testsuite/22_locale/conversions/buffer/1.cc b/libstdc++-v3/testsuite/22_locale/conversions/buffer/1.cc index 6b1ea950213..63125665d72 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/buffer/1.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/buffer/1.cc @@ -29,6 +29,7 @@ struct cvt : std::codecvt { }; template using buf_conv = std::wbuffer_convert, Elem>; +// { dg-warning "deprecated" "" { target c++17 } 31 } using std::string; using std::wstring; diff --git a/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc b/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc index 42653a9c7b7..5b3da130359 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc @@ -27,6 +27,7 @@ test01() struct Cvt : std::codecvt { }; std::stringstream ss; std::wbuffer_convert cvt(ss.rdbuf()); + // { dg-warning "deprecated" "" { target c++17 } 29 } auto p = ss.std::ios::rdbuf(&cvt); ss << "hello"; VERIFY( ss.flush().good() ); diff --git a/libstdc++-v3/testsuite/22_locale/conversions/buffer/3.cc b/libstdc++-v3/testsuite/22_locale/conversions/buffer/3.cc index de2c1a41322..5dcb9c5ec75 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/buffer/3.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/buffer/3.cc @@ -47,6 +47,7 @@ test01() // https://gcc.gnu.org/ml/libstdc++/2017-11/msg00022.html streambuf sb; std::wbuffer_convert conv(&sb); + // { dg-warning "deprecated" "" { target c++17 } 49 } VERIFY( sb.in_avail() == 0 ); wchar_t c = conv.sgetc(); VERIFY( c == L'a' ); @@ -61,6 +62,7 @@ test02() // https://gcc.gnu.org/ml/libstdc++/2017-11/msg00022.html streambuf sb; std::wbuffer_convert conv(&sb); + // { dg-warning "deprecated" "" { target c++17 } 64 } VERIFY( sb.in_avail() == 0 ); char16_t c = conv.sgetc(); VERIFY( c == u'a' ); diff --git a/libstdc++-v3/testsuite/22_locale/conversions/buffer/requirements/typedefs.cc b/libstdc++-v3/testsuite/22_locale/conversions/buffer/requirements/typedefs.cc index 2f4ca01b906..bdd3c578247 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/buffer/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/buffer/requirements/typedefs.cc @@ -27,7 +27,7 @@ void test01() // Check for required typedefs struct cvt_type : std::codecvt { }; typedef std::char_traits traits_type; - typedef std::wbuffer_convert test_type; + typedef std::wbuffer_convert test_type; // { dg-warning "deprecated" "" { target c++17 } } typedef test_type::state_type state_type; static_assert( std::is_same::value, diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc index b41bdc5ddfe..33b9bdc6b5e 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc @@ -29,6 +29,7 @@ struct cvt : std::codecvt { }; template using str_conv = std::wstring_convert, Elem>; +// { dg-warning "deprecated" "" { target c++17 } 31 } using std::string; using std::wstring; diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc index ac97ff4156a..c2b6496b9ae 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc @@ -28,6 +28,7 @@ struct cvt : std::codecvt { }; template using str_conv = std::wstring_convert, Elem>; +// { dg-warning "deprecated" "" { target c++17 } 30 } using std::string; using std::u16string; diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc index 5570ab621aa..5a669e78ce1 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc @@ -28,6 +28,7 @@ struct cvt : std::codecvt { }; template using str_conv = std::wstring_convert, Elem>; +// { dg-warning "deprecated" "" { target c++17 } 30 } using std::string; using std::u16string; diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/66441.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/66441.cc index 104d2f77584..f27204a5630 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/66441.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/66441.cc @@ -29,6 +29,7 @@ test01() // convert from UCS-4 to UTF16BE with BOM. using cvt = std::codecvt_utf16; std::wstring_convert conv; + // { dg-warning "deprecated" "" { target c++17 } 31 } auto to = conv.to_bytes(U"ab\u00e7"); VERIFY( to.length() == 8 ); diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs-2.cc index 487f890e94e..5026b8c68b1 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs-2.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs-2.cc @@ -33,6 +33,7 @@ template struct cvt : std::codecvt { }; using wconv = std::wstring_convert, alloc>; +// { dg-warning "deprecated" "" { target c++17 } 35 } static_assert( std::is_same>::value, "byte string is std::string" ); diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs.cc index d7f5e441738..9405df4c3ad 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs.cc @@ -26,6 +26,7 @@ void test01() // Check for required typedefs typedef std::codecvt codecvt_type; typedef std::wstring_convert test_type; + // { dg-warning "deprecated" "" { target c++17 } 28 } typedef test_type::byte_string byte_string; typedef test_type::wide_string wide_string; typedef test_type::state_type state_type; From patchwork Thu Jun 20 15:35:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1950256 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=FnPREtBn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4l6P3Zl4z20KL for ; Fri, 21 Jun 2024 01:39:41 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9554A3894C18 for ; Thu, 20 Jun 2024 15:39:39 +0000 (GMT) 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.129.124]) by sourceware.org (Postfix) with ESMTPS id 9B7473895FE1 for ; Thu, 20 Jun 2024 15:36:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B7473895FE1 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 9B7473895FE1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718897789; cv=none; b=otNO3+mOq+VmuGZ43Yr3x4qacRD68IWqn8ggKVDDRNvMc+1ymDPVraq4PIQZ1tqk2R5DrEOIxWWhpQ5pJJWMtyvqEZkU9/tr5SoCcC1/hXpITGDPiV+UZyU9q/g89ld2NUkhVeR4feLkXK9x12UPXyEBYcQT1mVVAWgCaLuPfD8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718897789; c=relaxed/simple; bh=nBBXmCwS+JFC8OjXHbBSv0RGawl6UkmzRsUQEooIYwc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=DzK+XQNILj+PaRMij6+//Yx0rPgx5exqCnEcp0PKX9iUMhRnkORjNTHW9BcHAMIY/JyLVfU/cBmSIk63IaH/6GbwH088a+ND14EmayF19UmCp5SZCTmTQZxowmF4GQUP61ZD4wOeEuqqR9z4NOGCZF/M1KU3lIUet2W/yKj20qE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718897785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2UUD2IgMgGYXzTdm+e0EL36SAeIW8cNH+XQoCzyMem4=; b=FnPREtBncT3qT69900yz+leBN1DqEqLGip7MLoN2RQfzBtT8OWb+a3nhWmMx5Nc8xc/+qa tfb6OYTXeytztXGQdHeuJDmqoUBzW0DVkTSyZtI01OnBtG+397zRco3/zeky492osJzj5O hCKQsIjq6aNxAhzF1Gl8gnJE3CpjJW8= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-wKOYv02KPMSiHJ6RW4XlFg-1; Thu, 20 Jun 2024 11:36:23 -0400 X-MC-Unique: wKOYv02KPMSiHJ6RW4XlFg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 77E9F1955E9C; Thu, 20 Jun 2024 15:36:22 +0000 (UTC) Received: from localhost (unknown [10.42.28.182]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 993F319560AF; Thu, 20 Jun 2024 15:36:21 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 2/3] libstdc++: Add deprecation warnings to types Date: Thu, 20 Jun 2024 16:35:53 +0100 Message-ID: <20240620153618.2024734-2-jwakely@redhat.com> In-Reply-To: <20240620153618.2024734-1-jwakely@redhat.com> References: <20240620153618.2024734-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.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, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP, T_FILL_THIS_FORM_SHORT, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. -- >8 -- libstdc++-v3/ChangeLog: * include/backward/backward_warning.h: Adjust comments to suggest as another alternative to . * include/backward/strstream (strstreambuf, istrstream) (ostrstream, strstream): Add deprecated attribute. --- .../include/backward/backward_warning.h | 12 +++++++---- libstdc++-v3/include/backward/strstream | 20 +++++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/libstdc++-v3/include/backward/backward_warning.h b/libstdc++-v3/include/backward/backward_warning.h index 3f3330327d4..834fc5680cc 100644 --- a/libstdc++-v3/include/backward/backward_warning.h +++ b/libstdc++-v3/include/backward/backward_warning.h @@ -40,10 +40,14 @@ A list of valid replacements is as follows: Use: Instead of: - , basic_stringbuf , strstreambuf - , basic_istringstream , istrstream - , basic_ostringstream , ostrstream - , basic_stringstream , strstream + , stringbuf + or , spanbuf , strstreambuf + , istringstream + or , ispanstream , istrstream + , ostringstream + or , ospanstream , ostrstream + , stringstream + or , spanstream , strstream , unordered_set , hash_set , unordered_multiset , hash_multiset , unordered_map , hash_map diff --git a/libstdc++-v3/include/backward/strstream b/libstdc++-v3/include/backward/strstream index 152e93767f6..5e421143385 100644 --- a/libstdc++-v3/include/backward/strstream +++ b/libstdc++-v3/include/backward/strstream @@ -57,6 +57,12 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION +#if __glibcxx_spanstream +# define _GLIBCXX_STRSTREAM_DEPR(A, B) _GLIBCXX_DEPRECATED_SUGGEST(A "' or '" B) +#else +# define _GLIBCXX_STRSTREAM_DEPR(A, B) _GLIBCXX_DEPRECATED_SUGGEST(A) +#endif + // Class strstreambuf, a streambuf class that manages an array of char. // Note that this class is not a template. class strstreambuf : public basic_streambuf > @@ -151,7 +157,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool _M_dynamic : 1; bool _M_frozen : 1; bool _M_constant : 1; - }; + } _GLIBCXX_STRSTREAM_DEPR("std::stringbuf", "std::spanbuf"); + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // Class istrstream, an istream that manages a strstreambuf. class istrstream : public basic_istream @@ -176,7 +185,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: strstreambuf _M_buf; - }; + } _GLIBCXX_STRSTREAM_DEPR("std::istringstream", "std::ispanstream"); // Class ostrstream class ostrstream : public basic_ostream @@ -201,7 +210,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: strstreambuf _M_buf; - }; + } _GLIBCXX_STRSTREAM_DEPR("std::ostringstream", "std::ospanstream"); // Class strstream class strstream : public basic_iostream @@ -231,7 +240,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: strstreambuf _M_buf; - }; + } _GLIBCXX_STRSTREAM_DEPR("std::stringstream", "std::spanstream"); + +#undef _GLIBCXX_STRSTREAM_DEPR +#pragma GCC diagnostic pop _GLIBCXX_END_NAMESPACE_VERSION } // namespace From patchwork Thu Jun 20 15:35:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1950251 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=U7i7h4jH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4l3S0TQnz20KL for ; Fri, 21 Jun 2024 01:37:07 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 122483894C2C for ; Thu, 20 Jun 2024 15:37:06 +0000 (GMT) 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.129.124]) by sourceware.org (Postfix) with ESMTPS id 4F6023893646 for ; Thu, 20 Jun 2024 15:36:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F6023893646 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 4F6023893646 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718897790; cv=none; b=v53it+Xb3ySyYH3FgLXVBwQzKI+ntmzHV4Ftronjb021g9h4eccuOZKmEmUgVNTYzM1SWX55YlAbV/ewPbFccO4+/NQ++0MKrqD0cURjRplYkwMVkY/LfgsV2XmbFI0WbvlsXcezL/YSNBU9ammB7E9SMMXprQXSVxAkWKkk8lg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718897790; c=relaxed/simple; bh=AluIKlaZH78AF4smPIiXRGxB9QN7proA71peAu00GpY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vXB2jCg9UEd5370m+YcXqkR3iFq30ySmPJXKgzX915ONR8xDxTMCFuxmNsgFYYD2peEraizs/ER0Eu+oIF84xw8w2S/bgNC3vSwxY2arhGXJ6pyODWvFV9fBoV6BWZ8970JNKZfmnAZ55erqBR7ALaurW76MBJ5GM2nVJ3lqSrQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718897789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2QihZeodApQjVJV/ZaoRwdqDxbMBLV32Gk3RGFINs48=; b=U7i7h4jH46EPVUw9STVCjiCKkBNP1hsyHfcJ8RmsVQK1XiH/I9CtV9D7Rl2nELVikAMCJ+ L4c6omNlwPiQwB9GPcw9b6duCOyDCr0CrRrM4ZMfZqjM8BV2yO549QRNTjtBg+BUlfHmWE Ud0pF+qA63gL4So62uMcN6r0p9twgD0= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-aNcbsTXtPZiEkL9olR6EoA-1; Thu, 20 Jun 2024 11:36:25 -0400 X-MC-Unique: aNcbsTXtPZiEkL9olR6EoA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1017C1955F1D; Thu, 20 Jun 2024 15:36:24 +0000 (UTC) Received: from localhost (unknown [10.42.28.182]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8862F1956048; Thu, 20 Jun 2024 15:36:23 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 3/3] libstdc++: Undeprecate std::pmr::polymorphic_allocator::destroy (P2875R4) Date: Thu, 20 Jun 2024 16:35:54 +0100 Message-ID: <20240620153618.2024734-3-jwakely@redhat.com> In-Reply-To: <20240620153618.2024734-1-jwakely@redhat.com> References: <20240620153618.2024734-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.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, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. -- >8 -- This member function was previously deprecated, but that was reverted by P2875R4, approved earlier this year in Tokyo. Since it's not going to be deprecated in C++26, and so presumably not removed, there is no point in giving deprecated warnings for C++23 mode. libstdc++-v3/ChangeLog: * include/bits/memory_resource.h (polymorphic_allocator::destroy): Remove deprecated attribute. --- libstdc++-v3/include/bits/memory_resource.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libstdc++-v3/include/bits/memory_resource.h b/libstdc++-v3/include/bits/memory_resource.h index 022371245c1..5f50b296df7 100644 --- a/libstdc++-v3/include/bits/memory_resource.h +++ b/libstdc++-v3/include/bits/memory_resource.h @@ -305,7 +305,6 @@ namespace pmr #endif template - _GLIBCXX20_DEPRECATED_SUGGEST("allocator_traits::destroy") __attribute__((__nonnull__)) void destroy(_Up* __p)