https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78717

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is because the std::basic_string::find function isn't marked 'inline' and
there is an explicit instantiation declaration for std::string. GCC simply
won't inline a non-inline function if there's an explicit instantiation of it.

With GCC 12 and -std=c++20 all members of std::basic_string are 'constexpr' and
so implicitly 'inline', and it gets inlined.

Reply via email to