Skip to content

Commit e0f2c71

Browse files
authored
tests: hide warning on clang (#5069)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 65370f3 commit e0f2c71

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_constants_and_functions.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ int f2(int x) noexcept(true) { return x + 2; }
5454
int f3(int x) noexcept(false) { return x + 3; }
5555
PYBIND11_WARNING_PUSH
5656
PYBIND11_WARNING_DISABLE_GCC("-Wdeprecated")
57+
#if defined(__clang_major__) && __clang_major__ >= 5
58+
PYBIND11_WARNING_DISABLE_CLANG("-Wdeprecated-dynamic-exception-spec")
59+
#else
5760
PYBIND11_WARNING_DISABLE_CLANG("-Wdeprecated")
61+
#endif
5862
// NOLINTNEXTLINE(modernize-use-noexcept)
5963
int f4(int x) throw() { return x + 4; } // Deprecated equivalent to noexcept(true)
6064
PYBIND11_WARNING_POP

0 commit comments

Comments
 (0)