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

Moncef Mechri <moncef.mechri at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |moncef.mechri at gmail dot com

--- Comment #12 from Moncef Mechri <moncef.mechri at gmail dot com> ---
I'm hitting a very similar issue, but with std::filesystem::directory_iterator:

#include <filesystem>

int main()
{
    for (const auto& filepath : std::filesystem::directory_iterator("/tmp"));
}

Compiled with -Os -fsanitize=undefined:

opt/compiler-explorer/gcc-14.2.0/bin/../lib/gcc/x86_64-linux-gnu/14.2.0/../../../../x86_64-linux-gnu/bin/ld:
/tmp/ccG3hzn8.o: in function `std::__shared_ptr<std::filesystem::__cxx11::_Dir,
(__gnu_cxx::_Lock_policy)2>::__shared_ptr()':
/opt/compiler-explorer/gcc-14.2.0/include/c++/14.2.0/bits/shared_ptr_base.h:1465:(.text.startup+0xde):
undefined reference to `std::__shared_ptr<std::filesystem::__cxx11::_Dir,
(__gnu_cxx::_Lock_policy)2>::__shared_ptr()'


Similar to what has already been described in this bug report, only GCC 14.1
and 14.2 seem impacted. The issue is not present in GCC 13 nor 15, or if using
any other sanitizer/optimization level.

Reply via email to