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 69B78385842C for ; Mon, 23 Aug 2021 15:17:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 69B78385842C 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-50-6UVIV3dRPXymWuankrrguQ-1; Mon, 23 Aug 2021 11:17:45 -0400 X-MC-Unique: 6UVIV3dRPXymWuankrrguQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B92C1853027; Mon, 23 Aug 2021 15:17:44 +0000 (UTC) Received: from localhost (unknown [10.33.36.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 064175D740; Mon, 23 Aug 2021 15:17:43 +0000 (UTC) Date: Mon, 23 Aug 2021 16:17:43 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add default template argument to basic_istream_view Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="VmlHZA/uMWBgZ0BK" Content-Disposition: inline X-Spam-Status: No, score=-14.2 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 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: Mon, 23 Aug 2021 15:17:58 -0000 --VmlHZA/uMWBgZ0BK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The standard shows this default template argument in the synopsis, but it was missing in libstdc++. libstdc++-v3/ChangeLog: * include/std/ranges (basic_istream_view): Add default template argument. * testsuite/std/ranges/istream_view.cc: Check it. Tested x86_64-linux. Committed to trunk. Backports to follow. --VmlHZA/uMWBgZ0BK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 1a129376bbc26d3c30af3c1ae6036e2e1446db40 Author: Jonathan Wakely Date: Mon Aug 23 16:16:05 2021 libstdc++: Add default template argument to basic_istream_view The standard shows this default template argument in the synopsis, but it was missing in libstdc++. libstdc++-v3/ChangeLog: * include/std/ranges (basic_istream_view): Add default template argument. * testsuite/std/ranges/istream_view.cc: Check it. diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 3d49a26ee79..b373e4f05c0 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -679,7 +679,8 @@ namespace views = requires(basic_istream<_CharT, _Traits>& is, _Val& t) { is >> t; }; } // namespace __detail - template + template> requires default_initializable<_Val> && __detail::__stream_extractable<_Val, _CharT, _Traits> class basic_istream_view diff --git a/libstdc++-v3/testsuite/std/ranges/istream_view.cc b/libstdc++-v3/testsuite/std/ranges/istream_view.cc index 2f15f787250..f5c0c2a6bb0 100644 --- a/libstdc++-v3/testsuite/std/ranges/istream_view.cc +++ b/libstdc++-v3/testsuite/std/ranges/istream_view.cc @@ -94,6 +94,15 @@ test05() ; } +void +test06() +{ + // Default template argument + using V = std::ranges::basic_istream_view; + using W = std::ranges::basic_istream_view>; + static_assert( std::is_same_v ); +} + int main() { @@ -102,4 +111,5 @@ main() test03(); test04(); test05(); + test06(); } --VmlHZA/uMWBgZ0BK--