[Bug libstdc++/78717] no definition of string::find when lowered to gimple
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Aug 22 11:46:19 GMT 2022
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.
More information about the Gcc-bugs
mailing list