https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974
Barry Revzin <barry.revzin at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |barry.revzin at gmail dot com --- Comment #19 from Barry Revzin <barry.revzin at gmail dot com> --- Another example of this: int get(); int const& f() { int const r = get(); return r; } int const& g() { int const& r = get(); return r; } gcc trunk warns on the incorrect use in f, but it does not currently warn on the incorrect use in g (which is the exact same bug). clang warns on both.