https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116277
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Frank Heckenbach from comment #3) > When 63446 was reported, gcc didn't have -Werror=dangling-reference, so a > false positive was perhaps better than no warning in this case back then. > Now it has the proper warning for this case. PR 49974 is tracking the missing warning dealing with `indirectly returning reference to local/temporary` which in this case that is what is happening via the lambda.