Bug ID: 85818
           Summary: [8/9 Regression] undefined reference to
           Product: gcc
           Version: 8.1.1
            Status: UNCONFIRMED
          Keywords: link-failure
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot
          Reporter: redi at gcc dot
  Target Milestone: ---

This fails to link when compiled as C++11 or C++14 with GCC 8 or 9:

#include <experimental/filesystem>

int main()
  auto& sep = std::experimental::filesystem::path::preferred_separator;

/tmp/ccxrMmnw.o: In function `main':
/tmp/ undefined reference to
collect2: error: ld returned 1 exit status

The variable is defined in src/filesystem/

constexpr path::value_type path::preferred_separator;

But that file is compiled with -std=gnu++17 and so the variable is implicitly
inline, and because it isn't used in that file its definition isn't emitted in

Reply via email to