[libcxx] r344192 - Use std::scoped_lock only for C++17 and newer

Aaron Puchert aaronpuchert at alice-dsl.net
Wed Oct 10 15:05:34 PDT 2018


Author: aaronpuchert
Date: Wed Oct 10 15:05:33 2018
New Revision: 344192

URL: http://llvm.org/viewvc/llvm-project?rev=344192&view=rev
Log:
Use std::scoped_lock only for C++17 and newer

This fixes a test failure caused by D53049.

Modified:
    libcxx/trunk/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp

Modified: libcxx/trunk/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp?rev=344192&r1=344191&r2=344192&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp Wed Oct 10 15:05:33 2018
@@ -25,8 +25,10 @@ std::mutex m;
 int foo __attribute__((guarded_by(m)));
 
 static void scoped() {
+#if __cplusplus >= 201703L
   std::scoped_lock<std::mutex> lock(m);
   foo++;
+#endif
 }
 
 int main() {




More information about the libcxx-commits mailing list