[libcxx-commits] [libcxx] [libc++][expected] Applied `[[nodiscard]]` (PR #170245)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 1 21:48:16 PST 2025


================
@@ -36,31 +36,31 @@ void test() {
   // !is_copy_constructible_v<T>,
   {
     const std::expected<NonCopyable, int> f1{5};
-    f1.value_or(5); // expected-note{{in instantiation of function template specialization 'std::expected<NonCopyable, int>::value_or<int>' requested here}}
+    (void)f1.value_or(5); // expected-note{{in instantiation of function template specialization 'std::expected<NonCopyable, int>::value_or<int>' requested here}}
----------------
frederick-vs-ja wrote:

```suggestion
    // expected-note at +1{{in instantiation of function template specialization 'std::expected<NonCopyable, int>::value_or<int>' requested here}}
    (void)f1.value_or(5); 
```

Ditto below.

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


More information about the libcxx-commits mailing list