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 62D103838016 for ; Tue, 10 May 2022 15:43:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 62D103838016 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-482wSPZXP1mNOCNBIu4EyQ-1; Tue, 10 May 2022 11:43:38 -0400 X-MC-Unique: 482wSPZXP1mNOCNBIu4EyQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D5ECA384F823; Tue, 10 May 2022 15:43:37 +0000 (UTC) Received: from localhost (unknown [10.33.36.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C0DE4010E46; Tue, 10 May 2022 15:43:37 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed 2/2] libstdc++: Add declarations to [PR105284] Date: Tue, 10 May 2022 16:43:35 +0100 Message-Id: <20220510154335.3714947-2-jwakely@redhat.com> In-Reply-To: <20220510154335.3714947-1-jwakely@redhat.com> References: <20220510154335.3714947-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 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, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: 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: Tue, 10 May 2022 15:43:42 -0000 Tested powerpc64le-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/105284 * include/std/iosfwd: Add declarations for class templates and typedefs. * include/std/spanstream (basic_spanbuf, basic_ispanstream) (basic_ospanstream, basic_spanstream): Remove default template arguments. * testsuite/27_io/headers/iosfwd/synopsis.cc: Add declarations. * testsuite/27_io/headers/iosfwd/types.cc: Check default arguments. --- libstdc++-v3/include/std/iosfwd | 23 +++++++++ libstdc++-v3/include/std/spanstream | 8 +-- .../27_io/headers/iosfwd/synopsis.cc | 13 +++++ .../testsuite/27_io/headers/iosfwd/types.cc | 50 +++++++++++++++++++ 4 files changed, 90 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd index c8c67c86c3b..ddf0c953856 100644 --- a/libstdc++-v3/include/std/iosfwd +++ b/libstdc++-v3/include/std/iosfwd @@ -225,6 +225,29 @@ _GLIBCXX_END_NAMESPACE_CXX11 #endif #endif // C++20 && CXX11_ABI +#if __cplusplus > 202002L + template> + class basic_spanbuf; + template> + class basic_ispanstream; + template> + class basic_ospanstream; + template> + class basic_spanstream; + + using spanbuf = basic_spanbuf; + using ispanstream = basic_ispanstream; + using ospanstream = basic_ospanstream; + using spanstream = basic_spanstream; + +#ifdef _GLIBCXX_USE_WCHAR_T + using wspanbuf = basic_spanbuf; + using wispanstream = basic_ispanstream; + using wospanstream = basic_ospanstream; + using wspanstream = basic_spanstream; +#endif +#endif // C++23 + /** @} */ _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/std/spanstream b/libstdc++-v3/include/std/spanstream index 000bda52a1e..5855b286efe 100644 --- a/libstdc++-v3/include/std/spanstream +++ b/libstdc++-v3/include/std/spanstream @@ -45,7 +45,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #define __cpp_lib_spanstream 202106L -template> +template class basic_spanbuf : public basic_streambuf<_CharT, _Traits> { @@ -218,7 +218,7 @@ template using spanbuf = basic_spanbuf; using wspanbuf = basic_spanbuf; -template> +template class basic_ispanstream : public basic_istream<_CharT, _Traits> { @@ -310,7 +310,7 @@ template using ispanstream = basic_ispanstream; using wispanstream = basic_ispanstream; -template> +template class basic_ospanstream : public basic_ostream<_CharT, _Traits> { @@ -378,7 +378,7 @@ template using ospanstream = basic_ospanstream; using wospanstream = basic_ospanstream; -template> +template class basic_spanstream : public basic_iostream<_CharT, _Traits> { diff --git a/libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc index 48f733bf28a..467d63609bd 100644 --- a/libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc +++ b/libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc @@ -75,6 +75,12 @@ _GLIBCXX_END_NAMESPACE_CXX11 typedef basic_ostringstream ostringstream; typedef basic_stringstream stringstream; +#if __cplusplus > 202002L + typedef basic_spanbuf spanbuf; + typedef basic_ispanstream ispanstream; + typedef basic_ospanstream ospanstream; + typedef basic_spanstream spanstream; +#endif typedef basic_filebuf filebuf; typedef basic_ifstream ifstream; @@ -96,6 +102,13 @@ _GLIBCXX_END_NAMESPACE_CXX11 typedef basic_ostringstream wostringstream; typedef basic_stringstream wstringstream; +#if __cplusplus > 202002L + typedef basic_spanbuf wspanbuf; + typedef basic_ispanstream wispanstream; + typedef basic_ospanstream wospanstream; + typedef basic_spanstream wspanstream; +#endif + typedef basic_filebuf wfilebuf; typedef basic_ifstream wifstream; typedef basic_ofstream wofstream; diff --git a/libstdc++-v3/testsuite/27_io/headers/iosfwd/types.cc b/libstdc++-v3/testsuite/27_io/headers/iosfwd/types.cc index e2c9c9b8dfa..baf37e910af 100644 --- a/libstdc++-v3/testsuite/27_io/headers/iosfwd/types.cc +++ b/libstdc++-v3/testsuite/27_io/headers/iosfwd/types.cc @@ -115,6 +115,56 @@ static_assert(Same, >::value, "std::basic_stringstream has the correct default template argument"); +#if __cplusplus > 202002L +using std::basic_spanbuf; + +static_assert(Same, + basic_spanbuf> + >::value, + "std::basic_spanbuf has the correct default template argument"); + +static_assert(Same, + basic_spanbuf> + >::value, + "std::basic_spanbuf has the correct default template argument"); + +using std::basic_ispanstream; + +static_assert(Same, + basic_ispanstream> + >::value, + "std::basic_ispanstream has the correct default template argument"); + +static_assert(Same, + basic_ispanstream> + >::value, + "std::basic_ispanstream has the correct default template argument"); + +using std::basic_ospanstream; + +static_assert(Same, + basic_ospanstream> + >::value, + "std::basic_ospanstream has the correct default template argument"); + +static_assert(Same, + basic_ospanstream> + >::value, + "std::basic_ospanstream has the correct default template argument"); + +using std::basic_spanstream; + +static_assert(Same, + basic_spanstream> + >::value, + "std::basic_spanstream has the correct default template argument"); + +static_assert(Same, + basic_spanstream> + >::value, + "std::basic_spanstream has the correct default template argument"); +#endif + using std::basic_filebuf; static_assert(Same, -- 2.34.1