[libcxx-commits] [libcxx] [libc++] Add [[gnu::warn_unused]] to a bunch of threading utilities (PR #213963)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 3 07:47:05 PDT 2026
================
@@ -69,3 +77,48 @@ void container_const_iterators() {
std::vector<int>::const_iterator m; // expected-warning {{unused variable}}
std::vector<bool>::const_iterator n; // expected-warning {{unused variable}}
}
+
+#ifndef TEST_HAS_NO_THREADS
+void synchronization(std::mutex& m) {
+ // <mutex>
+ std::mutex a; // expected-warning {{unused variable}}
+ std::once_flag b; // expected-warning {{unused variable}}
+ std::recursive_mutex c; // expected-warning {{unused variable}}
+ std::recursive_timed_mutex d; // expected-warning {{unused variable}}
+ std::timed_mutex e; // expected-warning {{unused variable}}
+ std::unique_lock<std::mutex> f; // TODO: We should warn on this
----------------
ldionne wrote:
Let's link to a Github issue instead (same below).
https://github.com/llvm/llvm-project/pull/213963
More information about the libcxx-commits
mailing list