[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
This commit is contained in:
Martin Storsjö 2021-02-26 09:58:50 +02:00
parent bf4dbc4984
commit 4adb4bca05
1 changed files with 1 additions and 0 deletions

View File

@ -22,6 +22,7 @@
int main(int, char**)
{
std::condition_variable cv;
static_cast<void>(cv);
return 0;
}