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.