This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51823] reverse iterator instantiated with POD type returns uninitialized values + work around
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Jan 2012 14:17:34 +0000
- Subject: [Bug libstdc++/51823] reverse iterator instantiated with POD type returns uninitialized values + work around
- Auto-submitted: auto-generated
- References: <bug-51823-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51823
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |NEW
Last reconfirmed| |2012-01-11
Resolution|INVALID |
Ever Confirmed|0 |1
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-11 14:17:34 UTC ---
actually, my bad, even if your type did meet the requirements it wouldn't work,
and that *is* a libstdc++ bug
at some point between C++03 and C++11 the definition of
reverse_iterator::operator* was changed to clarify this, making libstdc++'s
implementation wrong. The standard now says:
[ Note: This operation must use an auxiliary member variable rather than a
temporary variable to avoid returning a reference that persists beyond the
lifetime of its associated iterator. (See 24.2.) âend note ]