This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/78346] std::search with binary comparison predicate uses invalid reference
- 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: Tue, 17 Jan 2017 18:07:41 +0000
- Subject: [Bug libstdc++/78346] std::search with binary comparison predicate uses invalid reference
- Auto-submitted: auto-generated
- References: <bug-78346-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78346
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to reagentoo from comment #0)
> boost::filesystem::path::iterator::dereference returns reference to a local
> member:
This means boost::filesystem::path::iterator fails to meet the ForwardIterator
requirements, see 24.2.5 [forward.iterators] paragraph 6 in the C++14 standard.
> http://melpon.org/wandbox/permlink/58aIbfJWeGgMKMdF
>
> As a proposed solution, _Iter_equals_iter might store copy of iterator
> rather than dereferenced
> value.
That is not necessary for a type that meets the ForwardIterator requirements.