This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/78346] std::search with binary comparison predicate uses invalid reference


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]