[libcxx-commits] [PATCH] D140911: [In Progress][libc++] Implement P2505R5(Monadic operations for std::expected)

Yurong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 8 07:26:37 PST 2023


yronglin added inline comments.


================
Comment at: libcxx/include/__expected/expected.h:641
+        __expected::__is_expected<_Up>::value, "result of f(value()) must be a specialization of std::expected");
+    static_assert(is_same_v<typename _Up::error_type, _Err>,
+                  "std::remove_cvref_t<decltype(f(value()))>>::error_type must same as error_type");
----------------
philnik wrote:
> This `typename` shouldn't be required anymore. Is it to support older Clang versions?
```
/Users/yrong/Developer/Toolchain/llvm/trunk/rel/include/c++/v1/__expected/expected.h:1267:29: error: template argument for template type parameter must be a type; did you forget 'typename'?
    static_assert(is_same_v<_Up::error_type, _Err>, "The result of f() must have the same error_type as this expected");
                            ^
                            typename 

```
I have encountered a compilation error, when execute `ninja check-cxx`, the failure test is `llvm-project/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.sh.cpp`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140911/new/

https://reviews.llvm.org/D140911



More information about the libcxx-commits mailing list