[libcxx-commits] [libcxx] [libc++][numeric] Marked saturation artithmetic functions as `[[nodiscard]]` (PR #166898)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Nov 7 19:27:56 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/numerics/nodiscard.verify.cpp libcxx/include/__numeric/saturation_arithmetic.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/numerics/nodiscard.verify.cpp b/libcxx/test/libcxx/numerics/nodiscard.verify.cpp
index ca933b2ed..19a58ca23 100644
--- a/libcxx/test/libcxx/numerics/nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/numerics/nodiscard.verify.cpp
@@ -31,5 +31,5 @@ void test() {
std::div_sat(94, 82); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
std::saturate_cast<signed int>(49); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
#endif // TEST_STD_VER >= 26
-// clang-format on
+ // clang-format on
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/166898
More information about the libcxx-commits
mailing list