This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/78030] Lambda capture expression (different results than Clang & MSVC)
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Oct 2016 01:22:08 +0000
- Subject: [Bug libstdc++/78030] Lambda capture expression (different results than Clang & MSVC)
- Auto-submitted: auto-generated
- References: <bug-78030-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78030
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The standard does not say the predicate can't be copied at all. So this is
invalid. There are more than one copy of the predicate floating around which
is why you get this behavior. GCC implements it by calling find_if so it
starts maybe the slow part of going though each element slowly; because of that
call, find_if copies the lambda which means now you have two s's.