https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116360
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- [[gnu::no_dangling]] std::string const& get_x(std::string const& force_x = "") noexcept; Fixes the warning and that is needed as mentioned in https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/C_002b_002b-Attributes.html#index-no_005fdangling-function-attribute and https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/C_002b_002b-Dialect-Options.html#index-Wdangling-reference .