[libcxx-commits] [libcxx] [libc++][mdspan] Applied `[[nodiscard]]` (PR #169326)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 24 05:39:33 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- libcxx/test/libcxx/containers/views/mdspan/nodiscard.verify.cpp libcxx/include/__mdspan/extents.h libcxx/include/__mdspan/mdspan.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/libcxx/containers/views/mdspan/nodiscard.verify.cpp b/libcxx/test/libcxx/containers/views/mdspan/nodiscard.verify.cpp
index 5e9a66582..ea5f8a147 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/nodiscard.verify.cpp
@@ -49,7 +49,7 @@ void test() {
   mdsp.stride(0);       // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
 
   // Helpers
-  
+
   std::extents<int, 1, 2> ex;
   ex.rank();           // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
   ex.rank_dynamic();   // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}

``````````

</details>


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


More information about the libcxx-commits mailing list