File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 51
51
# define PYBIND11_DISABLE_WARNING_MSVC (name )
52
52
#endif
53
53
54
+ #ifdef PYBIND11_COMPILER_CLANG
55
+ # define PYBIND11_DISABLE_WARNING_CLANG (name ) PYBIND11_PRAGMA(clang diagnostic push # name)
56
+ #else
57
+ # define PYBIND11_DISABLE_WARNING_CLANG (name )
58
+ #endif
59
+
54
60
#ifdef PYBIND11_COMPILER_GCC
55
61
# define PYBIND11_DISABLE_WARNING_GCC (name ) PYBIND11_PRAGMA(GCC diagnostic ignored # name)
56
62
#else
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ int f2(int x) noexcept(true) { return x + 2; }
54
54
int f3 (int x) noexcept (false ) { return x + 3 ; }
55
55
PYBIND11_WARNING_PUSH
56
56
PYBIND11_DISABLE_WARNING_GCC (-Wdeprecated)
57
+ PYBIND11_DISABLE_WARNING_CLANG (-Wdeprecated)
57
58
// NOLINTNEXTLINE(modernize-use-noexcept)
58
59
int f4 (int x) throw() { return x + 4 ; } // Deprecated equivalent to noexcept(true)
59
60
PYBIND11_WARNING_POP
@@ -66,6 +67,7 @@ struct C {
66
67
int m6 (int x) const noexcept (false ) { return x - 6 ; }
67
68
PYBIND11_WARNING_PUSH
68
69
PYBIND11_DISABLE_WARNING_GCC (-Wdeprecated)
70
+ PYBIND11_DISABLE_WARNING_CLANG (-Wdeprecated)
69
71
// NOLINTNEXTLINE(modernize-use-noexcept)
70
72
int m7 (int x) throw() { return x - 7 ; }
71
73
// NOLINTNEXTLINE(modernize-use-noexcept)
You can’t perform that action at this time.
0 commit comments