https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974
--- Comment #21 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #2) > Maybe related, but not the same. PR986 involves creating a temporary and > binding the reference to it, that should be easier to warn about. Here's a > similar case to PR986 where a reference member is dangling after the > constructor, which we fail to warn about: > > struct Y { > Y(int local) : ref(local) { } > int& ref; > }; That is also filed as PR 63181.