From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id B391E3858404; Mon, 23 Aug 2021 16:05:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B391E3858404 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-8895] libstdc++: Add default template argument to basic_istream_view X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 05dbde3bfb91b5a643b68d00609a1aab1a6f47a0 X-Git-Newrev: f918470940d9737396f3a087de4fbb4e70e874a6 Message-Id: <20210823160531.B391E3858404@sourceware.org> Date: Mon, 23 Aug 2021 16:05:31 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2021 16:05:31 -0000 https://gcc.gnu.org/g:f918470940d9737396f3a087de4fbb4e70e874a6 commit r11-8895-gf918470940d9737396f3a087de4fbb4e70e874a6 Author: Jonathan Wakely Date: Mon Aug 23 16:16:05 2021 +0100 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. (cherry picked from commit 1a129376bbc26d3c30af3c1ae6036e2e1446db40) Diff: --- libstdc++-v3/include/std/ranges | 3 ++- libstdc++-v3/testsuite/std/ranges/istream_view.cc | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 9d1c4e1356a..3ef352949df 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -632,7 +632,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 369790e89e5..af76a1ab39e 100644 --- a/libstdc++-v3/testsuite/std/ranges/istream_view.cc +++ b/libstdc++-v3/testsuite/std/ranges/istream_view.cc @@ -83,6 +83,15 @@ test04() static_assert(!std::forward_iterator); } +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() { @@ -90,4 +99,5 @@ main() test02(); test03(); test04(); + test06(); }