<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64810>64810</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
|libc++] Compilation errors when compiling libc++ std module on windows
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Arthapz
</td>
</tr>
</table>
<pre>
Hello, i'm getting a weird error with clang and libc++ std module on windows (using ucrt)
```
C:\Dev\llvm\include\c++\v1\__expected\expected.h:84:29: error: missing '#include <__expected/expected.h>'; '_Err' must be declared before it is used
84 | throw bad_expected_access<_Err>(std::forward<_Arg>(__arg));
| ^
C:\Dev\llvm\include\c++\v1\__expected\expected.h:81:17: note: declaration here is not visible
81 | template <class _Err, class _Arg>
| ^
C:\Dev\llvm\include\c++\v1\__expected\expected.h:84:48: error: missing '#include <__expected/expected.h>'; '_Arg' must be declared before it is used
84 | throw bad_expected_access<_Err>(std::forward<_Arg>(__arg));
| ^
C:\Dev\llvm\include\c++\v1\__expected\expected.h:81:29: note: declaration here is not visible
81 | template <class _Err, class _Arg>
| ^
C:\Dev\llvm\include\c++\v1\__expected\expected.h:84:54: error: missing '#include <__expected/expected.h>'; '__arg' must be declared before it is used
84 | throw bad_expected_access<_Err>(std::forward<_Arg>(__arg));
| ^
C:\Dev\llvm\include\c++\v1\__expected\expected.h:82:63: note: declaration here is not visible
82 | _LIBCPP_HIDE_FROM_ABI void __throw_bad_expected_access(_Arg&& __arg) {
```
here a self contained reproducer with full logs: https://github.com/Arthapz/libc--error-expected
```
> clang --version 18:58:30
clang version 18.0.0 (https://github.com/llvm/llvm-project.git ef82a53bbb89e831bb524d1b8a60458abb86ce99)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Dev\llvm\bin
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkVlGPozYQ_jWTl1EisDGQBx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