Although not testing the annotations feature, the test still needs guarding for thread-safety otherwise it will not compile at all.
I don't actually understand this change. This test should compile with or without "-Wthread-safety" warning. This test doesn't actually turn the annotations on, that's the point. If annotations were actually enabled this test would fail to compile.
Could you explain the error your seeing here?
Sorry for the delay - I originally detected the failure while not running in a totally clean environment with clean sources, but I can reproduce on clean code.
I can reproduce by building with clean clang and libcxx sources:
cmake -DLLVM_PATH=/work/ricbar01/llvm_oss/ -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_CXX_ABI_INCLUDE_PATHS=../../libcxxabi_oss/include -DCMAKE_C_COMPILER=/work/ricbar01/llvm_oss/build/bin/clang -DCMAKE_CXX_COMPILER=/work/ricbar01/llvm_oss/build/bin/clang++ -DLIBCXX_ENABLE_THREADS=OFF -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF ..
I get errors like:
/work/ricbar01/libcxx_oss/test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp:21:8: error: no type named 'mutex' in namespace 'std'
From eyeballing the include/mutex it looks like the mutex class is #ifdeffec out when _LIBCPP_HAS_NO_THREADS is unset.
And looking at the current state of the single-threaded test suite this isn't the only test that needs this fix applied.
Indeed! I assumed by reading other nearby tests that there was some mechanism that disabled the thread/ tests when threads were disabled, but didn't verify this. Sorry about the breakage.