[libcxx-commits] [libcxx] [libc++] Applied `[[nodiscard]` to `<exception>`, `<stdexcept>` and `<system_error>` (PR #170837)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Dec 5 03:48:47 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 ,h,cpp -- libcxx/test/libcxx/diagnostics/syserr/nodiscard.verify.cpp libcxx/include/__exception/exception.h libcxx/include/__exception/nested_exception.h libcxx/include/__exception/operations.h libcxx/include/__system_error/error_category.h libcxx/include/__system_error/error_code.h libcxx/include/__system_error/error_condition.h libcxx/include/__system_error/system_error.h libcxx/include/stdexcept libcxx/test/libcxx/language.support/nodiscard.verify.cpp --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/language.support/nodiscard.verify.cpp b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp
index db5632d25..9957a6f4d 100644
--- a/libcxx/test/libcxx/language.support/nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp
@@ -86,7 +86,7 @@ void test() {
#endif
{ // <exception>
- std:: bad_exception bex;
+ std::bad_exception bex;
bex.what(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
``````````
</details>
https://github.com/llvm/llvm-project/pull/170837
More information about the libcxx-commits
mailing list