[Bug c++/49974] missing -Wreturn-local-addr for indirectly returning reference to local/temporary

2024-02-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974 --- Comment #20 from Andrew Pinski --- (In reply to Barry Revzin from comment #19) > Another example of this: > > int get(); > > int const& f() { > int const r = get(); > return r; > } > > int const& g() { > int const& r = get();

[Bug c++/49974] missing -Wreturn-local-addr for indirectly returning reference to local/temporary

2024-02-15 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com ---

[Bug c++/49974] missing -Wreturn-local-addr for indirectly returning reference to local/temporary

2022-01-15 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974 --- Comment #18 from Martin Sebor --- This detection is partially implemented in GCC 12 by the -Wdnagling-pointer: $ cat pr49974.C && gcc -O -S -Wall pr49974.C struct X { }; inline const X& f(const X& r) { return r; } const X& g() { X x;

[Bug c++/49974] missing -Wreturn-local-addr for indirectly returning reference to local/temporary

2020-06-26 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974 --- Comment #17 from Jonathan Wakely --- 95911 boils down to this: #include struct X { int i = 0; }; X&& f(X&& x) { return std::move(x); } int main() { X&& x = f(X{}); return x.i; } With recent releases we get a -Wuninitialized

[Bug c++/49974] missing -Wreturn-local-addr for indirectly returning reference to local/temporary

2020-06-26 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974 Jonathan Wakely changed: What|Removed |Added CC||570070308 at qq dot com --- Comment

[Bug c++/49974] missing -Wreturn-local-addr for indirectly returning reference to local/temporary

2019-09-24 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org See

[Bug c++/49974] missing -Wreturn-local-addr for indirectly returning reference to local/temporary

2018-11-21 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974 Eric Gallager changed: What|Removed |Added Summary|missing warning for |missing -Wreturn-local-addr