Skip to content

Commit 4adb4bc

Browse files
committed
[libcxx] [test] Fix a test error with condvars with trivial destruction
If the destructor is trivial (_LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION, the constructor always is), the compiler warns about the std::condition_variable being unused. Add a cast to void to silence the warning about the object being unused. Differential Revision: https://reviews.llvm.org/D97540
1 parent bf4dbc4 commit 4adb4bc

File tree

1 file changed

+1
-0
lines changed
  • libcxx/test/std/thread/thread.condition/thread.condition.condvar

1 file changed

+1
-0
lines changed

libcxx/test/std/thread/thread.condition/thread.condition.condvar/default.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
int main(int, char**)
2323
{
2424
std::condition_variable cv;
25+
static_cast<void>(cv);
2526

2627
return 0;
2728
}

0 commit comments

Comments
 (0)