| Issue |
115326
|
| Summary |
[libc++] Rejects-valid on unexpected(1) == unexpected(1L)
|
| Labels |
libc++
|
| Assignees |
frederick-vs-ja
|
| Reporter |
ldionne
|
Minimal reproducer:
```
#include <expected>
static_assert(std::unexpected(1) == std::unexpected(1L));
```
Output:
```
__expected/unexpected.h:111:31: error: '__unex_' is a private member of 'std::unexpected<long>'
111 | return __x.__unex_ == __y.__unex_;
| ^
```
Godbolt: https://godbolt.org/z/a8rPnKz1Y
The fix is to use `__y.error()` instead of `__y.__unex_`.
This was originally discovered in https://github.com/Quuxplusone/llvm-project/issues/40.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs