[libcxx-commits] [libcxx] Rename operator[].pass.cpp to subscript_operator.pass.cpp (PR #117216)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Nov 21 15:48:23 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 29afbd5893fbf68a2b64321bee0c82233b8b852e 834fb39fd605d9d2069fc2d81695fb927fe44f32 --extensions cpp -- libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.members/subscript_operator.pass.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.members/subscript_operator.pass.cpp b/libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.members/subscript_operator.pass.cpp
index 1900f00ba7..b2a1146c4a 100644
--- a/libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.members/subscript_operator.pass.cpp
+++ b/libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.members/subscript_operator.pass.cpp
@@ -13,7 +13,6 @@
// constexpr weekday_indexed operator[](unsigned index) const noexcept;
// constexpr weekday_last operator[](last_spec) const noexcept;
-
#include <chrono>
#include <cassert>
#include <type_traits>
@@ -22,39 +21,36 @@
#include "test_macros.h"
#include "../../euclidian.h"
-int main(int, char**)
-{
- using weekday = std::chrono::weekday;
- using weekday_last = std::chrono::weekday_last;
- using weekday_indexed = std::chrono::weekday_indexed;
+int main(int, char**) {
+ using weekday = std::chrono::weekday;
+ using weekday_last = std::chrono::weekday_last;
+ using weekday_indexed = std::chrono::weekday_indexed;
- constexpr weekday Sunday = std::chrono::Sunday;
+ constexpr weekday Sunday = std::chrono::Sunday;
- ASSERT_NOEXCEPT( std::declval<weekday>()[1U]);
- ASSERT_SAME_TYPE(weekday_indexed, decltype(std::declval<weekday>()[1U]));
+ ASSERT_NOEXCEPT(std::declval<weekday>()[1U]);
+ ASSERT_SAME_TYPE(weekday_indexed, decltype(std::declval<weekday>()[1U]));
- ASSERT_NOEXCEPT( std::declval<weekday>()[std::chrono::last]);
- ASSERT_SAME_TYPE(weekday_last, decltype(std::declval<weekday>()[std::chrono::last]));
+ ASSERT_NOEXCEPT(std::declval<weekday>()[std::chrono::last]);
+ ASSERT_SAME_TYPE(weekday_last, decltype(std::declval<weekday>()[std::chrono::last]));
- static_assert(Sunday[2].weekday() == Sunday, "");
- static_assert(Sunday[2].index () == 2, "");
+ static_assert(Sunday[2].weekday() == Sunday, "");
+ static_assert(Sunday[2].index() == 2, "");
- for (unsigned i = 0; i <= 6; ++i)
- {
- weekday wd(i);
- weekday_last wdl = wd[std::chrono::last];
- assert(wdl.weekday() == wd);
- assert(wdl.ok());
- }
+ for (unsigned i = 0; i <= 6; ++i) {
+ weekday wd(i);
+ weekday_last wdl = wd[std::chrono::last];
+ assert(wdl.weekday() == wd);
+ assert(wdl.ok());
+ }
- for (unsigned i = 0; i <= 6; ++i)
- for (unsigned j = 1; j <= 5; ++j)
- {
- weekday wd(i);
- weekday_indexed wdi = wd[j];
- assert(wdi.weekday() == wd);
- assert(wdi.index() == j);
- assert(wdi.ok());
+ for (unsigned i = 0; i <= 6; ++i)
+ for (unsigned j = 1; j <= 5; ++j) {
+ weekday wd(i);
+ weekday_indexed wdi = wd[j];
+ assert(wdi.weekday() == wd);
+ assert(wdi.index() == j);
+ assert(wdi.ok());
}
return 0;
``````````
</details>
https://github.com/llvm/llvm-project/pull/117216
More information about the libcxx-commits
mailing list