[gcc/devel/c++-coroutines] libstdc++ Fix missing return in istream_view iterator

Iain D Sandoe iains@gcc.gnu.org
Fri Feb 7 20:27:00 GMT 2020


https://gcc.gnu.org/g:572992c8920d5339a3ac28d442c436d6daa0bfae

commit 572992c8920d5339a3ac28d442c436d6daa0bfae
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Feb 7 16:06:43 2020 +0000

    libstdc++ Fix missing return in istream_view iterator
    
    	* include/std/ranges (iota_view): Add braces to prevent -Wempty-body
    	warning.
    	(basic_istream_view::_Iterator::operator++()): Add missing return.

Diff:
---
 libstdc++-v3/ChangeLog          | 6 ++++++
 libstdc++-v3/include/std/ranges | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 946897d..7c9a8a6 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,9 @@
+2020-02-07  Jonathan Wakely  <jwakely@redhat.com>
+
+	* include/std/ranges (iota_view): Add braces to prevent -Wempty-body
+	warning.
+	(basic_istream_view::_Iterator::operator++()): Add missing return.
+
 2020-02-07  Patrick Palka  <ppalka@redhat.com>
 
 	* include/bits/ranges_algo.h: Remove extraneous &&.
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index dd0c5cf..891ecf7 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -872,7 +872,9 @@ namespace ranges
       : _M_value(__value), _M_bound(__bound)
       {
 	if constexpr (totally_ordered_with<_Winc, _Bound>)
-	  __glibcxx_assert( bool(__value <= __bound) );
+	  {
+	    __glibcxx_assert( bool(__value <= __bound) );
+	  }
       }
 
       constexpr _Iterator
@@ -1012,6 +1014,7 @@ namespace views
 	{
 	  __glibcxx_assert(_M_parent->_M_stream != nullptr);
 	  *_M_parent->_M_stream >> _M_parent->_M_object;
+	  return *this;
 	}
 
 	void



More information about the Libstdc++-cvs mailing list