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

            Bug ID: 108636
           Summary: C++20 to undefined reference to
                    `std::filesystem::__cxx11::path::_List::type(std::file
                    system::__cxx11::path::_Type)' with
                    -fkeep-inline-functions
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hnc at singularity dot fr
  Target Milestone: ---

Hi

Compilers:
GCC 10.1 to 12.2

Code:
```
#include <filesystem>
int main() { return 0; }
```

Flags:
`-std=c++20 -pedantic -fkeep-inline-functions`
(adding `-lstdc++fs` does not help)

The compilation fails with this link error:
```
in function `std::filesystem::__cxx11::path::path(std::basic_string_view<char,
std::char_traits<char> >, std::filesystem::__cxx11::path::_Type)':
/usr/include/c++/12/bits/fs_path.h:606: undefined reference to
`std::filesystem::__cxx11::path::_List::type(std::filesystem::__cxx11::path::_Type)'
```

It compiles without `-fkeep-inline-functions` flag.

Thanks

Reply via email to