[libcxx-commits] [libcxx] [libc++][hardening] Add checks to `forward_list` element access. (PR #120858)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 21 14:58:27 PST 2024


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 fd784726db70a5155594c32ee839b8807fafd87d efc849d93f8da1f09b50cd34de0ab91379ebcb0d --extensions ,cpp -- libcxx/test/libcxx/containers/sequences/forwardlist/assert.pass.cpp libcxx/include/forward_list
``````````

</details>

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

``````````diff
diff --git a/libcxx/test/libcxx/containers/sequences/forwardlist/assert.pass.cpp b/libcxx/test/libcxx/containers/sequences/forwardlist/assert.pass.cpp
index e442d75a59..4d3fb686b2 100644
--- a/libcxx/test/libcxx/containers/sequences/forwardlist/assert.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/forwardlist/assert.pass.cpp
@@ -33,7 +33,7 @@ int main(int, char**) {
     const auto& const_c = c;
     c.push_front(1);
 
-    (void)c.front(); // Check that there's no assertion on valid access.
+    (void)c.front();       // Check that there's no assertion on valid access.
     (void)const_c.front(); // Check that there's no assertion on valid access.
     c.pop_front();
     TEST_LIBCPP_ASSERT_FAILURE(c.pop_front(), "forward_list::pop_front called on an empty list");

``````````

</details>


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


More information about the libcxx-commits mailing list