[libcxx-commits] [libcxx] [libc++][NFC] Add optional bounded iterator tests (PR #176597)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jan 17 14:14:43 PST 2026
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/optional/optional.object/optional.iterator/assert.bounded_iterator.pass.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/utilities/optional/optional.object/optional.iterator/assert.bounded_iterator.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.iterator/assert.bounded_iterator.pass.cpp
index e549d9585..338cd4411 100644
--- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.iterator/assert.bounded_iterator.pass.cpp
+++ b/libcxx/test/libcxx/utilities/optional/optional.object/optional.iterator/assert.bounded_iterator.pass.cpp
@@ -63,7 +63,8 @@ int main(int, char**) {
std::optional<int> o{1};
auto i = o.end();
- TEST_LIBCPP_ASSERT_FAILURE(i.operator->(), "__bounded_iter::operator->: Attempt to dereference an iterator at the end");
+ TEST_LIBCPP_ASSERT_FAILURE(
+ i.operator->(), "__bounded_iter::operator->: Attempt to dereference an iterator at the end");
}
{ // operator+=
@@ -78,7 +79,7 @@ int main(int, char**) {
std::optional<int> o{1};
auto i = o.begin();
- TEST_LIBCPP_ASSERT_FAILURE(i -= 1, "__bounded_iter::operator-=: Attempt to rewind an iterator past the start");
+ TEST_LIBCPP_ASSERT_FAILURE(i -= 1, "__bounded_iter::operator-=: Attempt to rewind an iterator past the start");
TEST_LIBCPP_ASSERT_FAILURE(i -= -2, "__bounded_iter::operator-=: Attempt to advance an iterator past the end");
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/176597
More information about the libcxx-commits
mailing list