[libcxx-commits] [libcxx] cd44260 - [libc++][test] Get rid of warning on macOS about undefined macro (#156785)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 4 00:00:36 PDT 2025


Author: A. Jiang
Date: 2025-09-04T09:00:31+02:00
New Revision: cd44260ee64f948b5a8ac9e49082c0c14fabf33f

URL: https://github.com/llvm/llvm-project/commit/cd44260ee64f948b5a8ac9e49082c0c14fabf33f
DIFF: https://github.com/llvm/llvm-project/commit/cd44260ee64f948b5a8ac9e49082c0c14fabf33f.diff

LOG: [libc++][test] Get rid of warning on macOS about undefined macro (#156785)

`TEST_CLANG_VER` is not defined for Apple Clang, so it's better to
detect whether the macro is defined to get rid of warnings due to
`-Wundef`. This also corresponds to the guard in `<mutex>`.

Added: 
    

Modified: 
    libcxx/test/extensions/clang/thread/thread.mutex/lock.verify.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/extensions/clang/thread/thread.mutex/lock.verify.cpp b/libcxx/test/extensions/clang/thread/thread.mutex/lock.verify.cpp
index c83a87d4901c3..51ffa6962ac83 100644
--- a/libcxx/test/extensions/clang/thread/thread.mutex/lock.verify.cpp
+++ b/libcxx/test/extensions/clang/thread/thread.mutex/lock.verify.cpp
@@ -31,7 +31,7 @@ void f1() {
 } // expected-warning {{mutex 'm0' is still held at the end of function}} \
      expected-warning {{mutex 'm1' is still held at the end of function}}
 
-#if TEST_STD_VER >= 11 && TEST_CLANG_VER >= 2101
+#if TEST_STD_VER >= 11 && defined(TEST_CLANG_VER) && TEST_CLANG_VER >= 2101
 void f2() {
   std::lock(m0, m1, m2);
 } // expected-warning {{mutex 'm0' is still held at the end of function}} \


        


More information about the libcxx-commits mailing list