https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109671
--- Comment #3 from Patrick J. LoPresti <lopresti at gmail dot com> --- (In reply to Andrew Pinski from comment #1) > There is no way for GCC to know that get_foo_by_name does not store the > argument into what is returned so it warns about this case ... To summarize: GCC is warning because it does not and cannot know whether I am managing object lifetimes correctly. The only way to silence the warning is to modify my code to make it uglier, into a form where GCC still does not and cannot know whether I am managing lifetimes correctly. So is this a valid bug report, or not?