From e0f2c71596dde6303803870c7c0ce13440b57dbe Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 26 Mar 2024 13:57:05 -0400 Subject: [PATCH] tests: hide warning on clang (#5069) Signed-off-by: Henry Schreiner --- tests/test_constants_and_functions.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_constants_and_functions.cpp b/tests/test_constants_and_functions.cpp index 312edca9e..bf42b4155 100644 --- a/tests/test_constants_and_functions.cpp +++ b/tests/test_constants_and_functions.cpp @@ -54,7 +54,11 @@ int f2(int x) noexcept(true) { return x + 2; } int f3(int x) noexcept(false) { return x + 3; } PYBIND11_WARNING_PUSH PYBIND11_WARNING_DISABLE_GCC("-Wdeprecated") +#if defined(__clang_major__) && __clang_major__ >= 5 +PYBIND11_WARNING_DISABLE_CLANG("-Wdeprecated-dynamic-exception-spec") +#else PYBIND11_WARNING_DISABLE_CLANG("-Wdeprecated") +#endif // NOLINTNEXTLINE(modernize-use-noexcept) int f4(int x) throw() { return x + 4; } // Deprecated equivalent to noexcept(true) PYBIND11_WARNING_POP