[libcxx-commits] [libcxx] [libc++][string] Assert resize_and_overwrite operation returns integer-like type (PR #162030)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Oct 5 15:45:19 PDT 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/std/strings/basic.string/string.capacity/resize_and_overwrite.verify.cpp libcxx/include/string libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp
``````````
: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/string b/libcxx/include/string
index 00592e615..562e9bec5 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -1312,7 +1312,7 @@ public:
template <class _Op>
_LIBCPP_HIDE_FROM_ABI constexpr void resize_and_overwrite(size_type __n, _Op __op) {
using __result_type = decltype(__op(data(), auto(__n)));
- static_assert(std::__integer_like<__result_type>, "Operation return type must be integer-like");
+ static_assert(std::__integer_like<__result_type>, "Operation return type must be integer-like");
size_type __sz = size();
size_type __cap = capacity();
if (__n > __cap)
``````````
</details>
https://github.com/llvm/llvm-project/pull/162030
More information about the libcxx-commits
mailing list