[Bug libstdc++/65543] rvalue stream insertion and extraction operators incorrectly implemented
paolo.carlini at oracle dot com
gcc-bugzilla@gcc.gnu.org
Wed Mar 25 01:44:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65543
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2015-03-24
CC| |jakub at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com
Target Milestone|--- |5.0
Ever confirmed|0 |1
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Strictly speaking this isn't a regression but I think the fix is trivial enough
to go in now (matter of reverting a dumb commit of mine dating back to August,
2009, r150387). I'm testing:
Index: include/std/istream
===================================================================
--- include/std/istream (revision 221642)
+++ include/std/istream (working copy)
@@ -922,7 +922,10 @@
template<typename _CharT, typename _Traits, typename _Tp>
inline basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
- { return (__is >> __x); }
+ {
+ __is >> __x;
+ return __is;
+ }
#endif // C++11
_GLIBCXX_END_NAMESPACE_VERSION
Index: include/std/ostream
===================================================================
--- include/std/ostream (revision 221642)
+++ include/std/ostream (working copy)
@@ -626,7 +626,10 @@
template<typename _CharT, typename _Traits, typename _Tp>
inline basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
- { return (__os << __x); }
+ {
+ __os << __x;
+ return __os;
+ }
#endif // C++11
_GLIBCXX_END_NAMESPACE_VERSION
More information about the Gcc-bugs
mailing list