[libcxx-commits] [libcxx] [libc++][test-suite][NFC] Move `unused_variables` tests (PR #223234)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Sep 13 04:42:44 PDT 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/thread/unused_variables.verify.cpp libcxx/test/libcxx/containers/unused_variables.compile.pass.cpp libcxx/test/libcxx/containers/unused_variables.verify.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/thread/unused_variables.verify.cpp b/libcxx/test/libcxx/thread/unused_variables.verify.cpp
index 0db58b42f..33c4e74ac 100644
--- a/libcxx/test/libcxx/thread/unused_variables.verify.cpp
+++ b/libcxx/test/libcxx/thread/unused_variables.verify.cpp
@@ -29,36 +29,36 @@ void synchronization(std::mutex& m) {
std::timed_mutex e; // expected-warning {{unused variable}}
std::unique_lock<std::mutex> f; // This is https://llvm.org/PR222655
std::unique_lock<std::mutex> g(m); // Shouldn't be diagnosed
-# if TEST_STD_VER >= 17
+#if TEST_STD_VER >= 17
std::unique_lock<std::mutex> h(m, std::defer_lock); // This is https://llvm.org/PR222655
-# endif
+#endif
// <condition_variable>
std::condition_variable i; // expected-warning {{unused variable}}
std::condition_variable_any j; // expected-warning {{unused variable}}
-# if TEST_STD_VER >= 20
+#if TEST_STD_VER >= 20
// <semaphore>
std::counting_semaphore<> k(1); // expected-warning {{unused variable}}
-# endif
+#endif
// <shared_mutex>
-# if TEST_STD_VER >= 17
+#if TEST_STD_VER >= 17
std::shared_mutex l; // expected-warning {{unused variable}}
-# endif
-# if TEST_STD_VER >= 14
+#endif
+#if TEST_STD_VER >= 14
std::shared_timed_mutex n; // expected-warning {{unused variable}}
std::shared_timed_mutex n2;
std::shared_lock<std::shared_timed_mutex> o; // This is https://llvm.org/PR222655
std::shared_lock<std::shared_timed_mutex> p(n2); // Shouldn't be diagnosed
std::shared_lock<std::shared_timed_mutex> q(n2, std::defer_lock); // This is https://llvm.org/PR222655
-# endif
+#endif
-# if TEST_STD_VER >= 20
+#if TEST_STD_VER >= 20
// <barrier>
std::barrier<> r(1); // expected-warning {{unused variable}}
// <latch>
std::latch s(1); // expected-warning {{unused variable}}
-# endif
+#endif
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/223234
More information about the libcxx-commits
mailing list