<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 - The filesystem::path::format type is not declared correctly."
href="https://bugs.llvm.org/show_bug.cgi?id=52536">52536</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>The filesystem::path::format type is not declared correctly.
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>11.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>edward.vogel@hpe.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>It seems that libc++ declares filesystem::path::format as a class. The
standard requires it to be an enum. This prevents programs from compiling when
-stdlib=libc++ is used. Here is a cut/paste from a cygwin session:
$ cat t.cpp
#include <filesystem>
#include <type_traits>
using namespace std;
int main(void)
{
typedef enum filesystem::path::format T1;
typedef std::underlying_type<T1>::type T2;
T1 a;
T2 b;
b = a;
}
VogelEd@XLB3502Q4E ~/tests/cppperen2.0
$ clang++ -std=c++17 t.cpp
VogelEd@XLB3502Q4E ~/tests/cppperen2.0
$ clang++ -std=c++17 -stdlib=libc++ t.cpp
t.cpp:11:7: error: assigning to 'T2' (aka 'unsigned char') from incompatible
type 'T1' (aka 'std::__1::__fs::filesystem::path::format')
b = a;
^
1 error generated.
Visual Studio 2019 also compiles the program.
The (V11) version of filesystem contains:
enum class _LIBCPP_ENUM_VIS format : unsigned char {
auto_format,
native_format,
generic_format
};
It seems g++ gets this right. They have:
enum format : unsigned char { native_format, generic_format, auto_format };
Not a significant problem, but I wanted to make you aware of it.
Thanks,
Ed Vogel</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>