https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109642
--- Comment #2 from Carlos Galvez <carlosgalvezp at gmail dot com> --- Is there a way to tag classes to mark them for exclusion? Currently the warning is part of -Wall and leads to many false positives. The warning message also says "possibly" dangling reference. In my opinion "possibly" type of warnings should not be part of -Wall due to the high FP rate. I also find it strange that it complains about const references, which anyway extend the lifetime of the temporary, or?