You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.m...
Eric Fiselier 276a69c18b Fix compile error with Bionic's PTHREAD_MUTEX_INITIALIZER
On Bionic PTHREAD_MUTEX_INITIALIZER contains the expression "<enum-type> & <integer-type>",
which causes ADL to perform name lookup for operator&. During this lookup Clang decides
that it requires the default member initializer for std::mutex while defining the DMI
for std::mutex::__m_.

If I'm not mistaken this is caused by the explicit noexcept declaration on the defaulted
constructor.

This patch removes the explicit noexcept and instead allows the compiler to declare
the default constructor implicitly noexcept. It also adds a static_assert to ensure
that happens.

Unfortunatly because it's not easy to change the value of _LIBCPP_MUTEX_INITIALIZER
for a single test there is no good way to test this patch.

The Clang behavior causing the trouble here was introduced in r287713, which first
appears in the 4.0 release.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304942 91177308-0d34-0410-b5e6-96231b3b80d8
8 years ago
..
thread.mutex.class Fix compile error with Bionic's PTHREAD_MUTEX_INITIALIZER 8 years ago
thread.mutex.recursive Move native_handle thread tests to test/libcxx 9 years ago
nothing_to_do.pass.cpp Move test into test/std subdirectory. 10 years ago