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++/78030] Lambda capture expression (different results than Clang & MSVC)


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.

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