Issue 108011
Summary [clang][libc++] std::expected not available until clang 20
Labels clang, libc++
Assignees
Reporter dawmd
    The following code doesn't compile until clang 20:

```cpp
#include <expected>

using type = std::expected<int, int>;
```

The compiler reports the following error (when using `-std=gnu++23`):

```
<source>:3:14: error: use of undeclared identifier 'std'
    3 | using type = std::expected<int, int>;
      | ^
```

According to [the reference for C++23 support in libc++](https://libcxx.llvm.org/Status/Cxx23.html), `std::expected` has been supported in clang 16 onward.

It seems as though the feature macro isn't defined in the previous versions for some reason.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to