https://bugs.llvm.org/show_bug.cgi?id=39193

            Bug ID: 39193
           Summary: std::filesystem::path::compare fails to link
           Product: libc++
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: vanboxem.ru...@gmail.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

This simple example program fails to compile with Clang/libc++ 7.0.0:

clang++ -stdlib=libc++ -std=c++17 main.c++
---
#include <filesystem>
#include <iostream>

int main()
{
    std::filesystem::path p("/home");

    auto p2 = p;

    if(p == p2)
        std::cout << "yay\n";
}
---

The errors I get are:
/usr/bin/ld: /tmp/main-da17c3.o: in function `main':
main.c++:(.text+0x31d): undefined reference to
`std::__1::__fs::filesystem::path::__compare(std::__1::basic_string_view<char,
std::__1::char_traits<char> >) const'
clang-7: error: linker command failed with exit code 1 (use -v to see
invocation)

Nothing changes if I
 - add -lc++experimental (it seems std::filesystem has moved to plain libc++ in
7.0?)
 - compile and link in separate steps

This worked fine with Clang/libc++ 6.0.1 before.
All this is on Arch Linux.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to