[libcxx-commits] [libcxx] [libc++][bitset] Applied `[[nodiscard]]` (PR #170623)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Dec 5 23:55:25 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 -- libcxx/test/libcxx/utilities/template.bitset/nodiscard.verify.cpp libcxx/include/__bit_reference libcxx/include/bitset --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/include/bitset b/libcxx/include/bitset
index f5e65e1f5..5de7d12a3 100644
--- a/libcxx/include/bitset
+++ b/libcxx/include/bitset
@@ -791,7 +791,8 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>
}
template <size_t _Size>
-[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>& bitset<_Size>::set() _NOEXCEPT {
+[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>&
+bitset<_Size>::set() _NOEXCEPT {
std::fill_n(__base::__make_iter(0), _Size, true);
return *this;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/170623
More information about the libcxx-commits
mailing list