https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108636
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:4b36925576d1097b20cddd29cf96c5b9ecfffc3d commit r12-10127-g4b36925576d1097b20cddd29cf96c5b9ecfffc3d Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu Feb 1 18:37:34 2024 +0000 libstdc++: Force-inline shared_ptr::operator bool() for C++20 [PR108636] This avoids a linker error with -fkeep-inline-functions when including <filesystem>. We can't backport the fix from trunk because it adds an export to the shared library. By marking the "missing" symbol always_inline for C++20 mode we don't need a definition in the library. libstdc++-v3/ChangeLog: PR libstdc++/108636 * include/bits/shared_ptr_base.h (__shared_ptr::operator bool): Add always_inline attribute for C++20 and later.