[libcxx-commits] [libcxx] 88ff246 - [libc++][test] Avoid `-Wunused-variable` warnings in mutex tests (#94907)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 10 06:55:01 PDT 2024
Author: Stephan T. Lavavej
Date: 2024-06-10T09:54:56-04:00
New Revision: 88ff2463ea9a8fb29e3981cabfa007e63bdd7317
URL: https://github.com/llvm/llvm-project/commit/88ff2463ea9a8fb29e3981cabfa007e63bdd7317
DIFF: https://github.com/llvm/llvm-project/commit/88ff2463ea9a8fb29e3981cabfa007e63bdd7317.diff
LOG: [libc++][test] Avoid `-Wunused-variable` warnings in mutex tests (#94907)
After enhancing MSVC's STL to statically initialize our condition_variable,
Clang began noticing that some mutexes in the test suite were unused.
Added:
Modified:
libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/default.pass.cpp
libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/default.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
index b278419df6eed..7a8d096994fff 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
@@ -19,9 +19,9 @@
#include "test_macros.h"
-int main(int, char**)
-{
- std::shared_timed_mutex m;
+int main(int, char**) {
+ std::shared_timed_mutex m;
+ (void)m;
return 0;
}
diff --git a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/default.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/default.pass.cpp
index d13a0ad435aea..c7f207372ac42 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/default.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.class/default.pass.cpp
@@ -18,9 +18,9 @@
#include "test_macros.h"
-int main(int, char**)
-{
- std::timed_mutex m;
+int main(int, char**) {
+ std::timed_mutex m;
+ (void)m;
return 0;
}
diff --git a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/default.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/default.pass.cpp
index 73e2e7a3a5ab9..3096e031855a2 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/default.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/default.pass.cpp
@@ -18,9 +18,9 @@
#include "test_macros.h"
-int main(int, char**)
-{
- std::recursive_timed_mutex m;
+int main(int, char**) {
+ std::recursive_timed_mutex m;
+ (void)m;
return 0;
}
More information about the libcxx-commits
mailing list