[libcxx-commits] [libcxx] [libc++] mark `std::expected` as `nodiscard` (PR #130820)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 12 08:05:26 PDT 2025


================
@@ -58,7 +58,7 @@ _LIBCPP_PUSH_MACROS
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Err>
-class expected;
+class [[nodiscrad]] expected;
----------------
frederick-vs-ja wrote:

> So what should I do? removing `nodiscard` from it?

Yep. This file should be kept unchanged.

https://github.com/llvm/llvm-project/pull/130820


More information about the libcxx-commits mailing list