<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - std::filesystem::path::compare fails to link"
href="https://bugs.llvm.org/show_bug.cgi?id=39193">39193</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>std::filesystem::path::compare fails to link
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>7.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>vanboxem.ruben@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>