https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60770
--- Comment #15 from Orgad Shaneh <orgads at gmail dot com> --- test.cpp: In function ‘int f(int)’: test.cpp:7:11: warning: ‘q’ is used uninitialized in this function [-Wuninitialized] 7 | return *p; | ^ Is this the intended description? It doesn't refer to the real problem (storing a pointer to a variable that is out of scope).