Skip to content

Commit cd44260

Browse files
[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>`.
1 parent 3821885 commit cd44260

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void f1() {
3131
} // expected-warning {{mutex 'm0' is still held at the end of function}} \
3232
expected-warning {{mutex 'm1' is still held at the end of function}}
3333

34-
#if TEST_STD_VER >= 11 && TEST_CLANG_VER >= 2101
34+
#if TEST_STD_VER >= 11 && defined(TEST_CLANG_VER) && TEST_CLANG_VER >= 2101
3535
void f2() {
3636
std::lock(m0, m1, m2);
3737
} // expected-warning {{mutex 'm0' is still held at the end of function}} \

0 commit comments

Comments
 (0)