This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/65861] libstdc++ is silently generating wrong code when its std::search is given an input iterator
- 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: Thu, 23 Apr 2015 15:21:21 +0000
- Subject: [Bug libstdc++/65861] libstdc++ is silently generating wrong code when its std::search is given an input iterator
- Auto-submitted: auto-generated
- References: <bug-65861-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65861
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jack Howarth from comment #3)
> Is the use of _GLIBCXX_CONCEPT_CHECKS well enough advertised in the
> documentation that we can expect the average developer to know to invoke it?
It's documented three times! :-)
https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html
https://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_compile_checks.html
https://gcc.gnu.org/onlinedocs/libstdc++/manual/concept_checking.html
(In reply to Jack Howarth from comment #4)
> Also, is there a simple fix to the test case which avoids the user error or
> does the code have to be rewritten in a major way.
Don't try to std::search in a streambuf, copy the data elsewhere and search in
the copy.