diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 3d49a26ee79c..b373e4f05c07 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 2f15f7872503..f5c0c2a6bb01 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(); }