File tree 4 files changed +18
-11
lines changed 4 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -143,12 +143,12 @@ class cpp_function : public function {
143
143
/* Without these pragmas, GCC warns that there might not be
144
144
enough space to use the placement new operator. However, the
145
145
'if' statement above ensures that this is the case. */
146
- #if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 6
146
+ #if defined(__GNUG__) && __GNUC__ >= 6 && !defined(__clang__) && !defined(__INTEL_COMPILER)
147
147
# pragma GCC diagnostic push
148
148
# pragma GCC diagnostic ignored "-Wplacement-new"
149
149
#endif
150
150
new ((capture *) &rec->data ) capture { std::forward<Func>(f) };
151
- #if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 6
151
+ #if defined(__GNUG__) && __GNUC__ >= 6 && !defined(__clang__) && !defined(__INTEL_COMPILER)
152
152
# pragma GCC diagnostic pop
153
153
#endif
154
154
if (!std::is_trivially_destructible<Func>::value)
@@ -2283,6 +2283,6 @@ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
2283
2283
2284
2284
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
2285
2285
# pragma warning(pop)
2286
- #elif defined(__GNUG__) && !defined(__clang__)
2286
+ #elif defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
2287
2287
# pragma GCC diagnostic pop
2288
2288
#endif
Original file line number Diff line number Diff line change @@ -268,8 +268,15 @@ function(pybind11_enable_warnings target_name)
268
268
target_compile_options (${target_name} PRIVATE /WX)
269
269
elseif (PYBIND11_CUDA_TESTS)
270
270
target_compile_options (${target_name} PRIVATE "SHELL:-Werror all-warnings" )
271
- elseif (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel| Clang)" )
271
+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang|IntelLLVM )" )
272
272
target_compile_options (${target_name} PRIVATE -Werror)
273
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" )
274
+ target_compile_options (
275
+ ${target_name}
276
+ PRIVATE
277
+ -Werror-all
278
+ # "Inlining inhibited by limit max-size", "Inlining inhibited by limit max-total-size"
279
+ -diag-disable 11074,11076)
273
280
endif ()
274
281
endif ()
275
282
Original file line number Diff line number Diff line change @@ -56,12 +56,12 @@ int f1(int x) noexcept { return x+1; }
56
56
#endif
57
57
int f2 (int x) noexcept (true ) { return x+2 ; }
58
58
int f3 (int x) noexcept (false ) { return x+3 ; }
59
- #if defined(__GNUG__)
59
+ #if defined(__GNUG__) && !defined(__INTEL_COMPILER)
60
60
# pragma GCC diagnostic push
61
61
# pragma GCC diagnostic ignored "-Wdeprecated"
62
62
#endif
63
63
int f4 (int x) throw() { return x+4 ; } // Deprecated equivalent to noexcept(true)
64
- #if defined(__GNUG__)
64
+ #if defined(__GNUG__) && !defined(__INTEL_COMPILER)
65
65
# pragma GCC diagnostic pop
66
66
#endif
67
67
struct C {
@@ -71,13 +71,13 @@ struct C {
71
71
int m4 (int x) const noexcept (true ) { return x-4 ; }
72
72
int m5 (int x) noexcept (false ) { return x-5 ; }
73
73
int m6 (int x) const noexcept (false ) { return x-6 ; }
74
- #if defined(__GNUG__)
74
+ #if defined(__GNUG__) && !defined(__INTEL_COMPILER)
75
75
# pragma GCC diagnostic push
76
76
# pragma GCC diagnostic ignored "-Wdeprecated"
77
77
#endif
78
78
int m7 (int x) throw() { return x-7 ; }
79
79
int m8 (int x) const throw() { return x-8 ; }
80
- #if defined(__GNUG__)
80
+ #if defined(__GNUG__) && !defined(__INTEL_COMPILER)
81
81
# pragma GCC diagnostic pop
82
82
#endif
83
83
};
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ std::string abs(const Vector2&) {
80
80
return " abs(Vector2)" ;
81
81
}
82
82
83
- // MSVC warns about unknown pragmas, and warnings are errors.
84
- #ifndef _MSC_VER
83
+ // MSVC & Intel warns about unknown pragmas, and warnings are errors.
84
+ #if !defined( _MSC_VER) && !defined(__INTEL_COMPILER)
85
85
#pragma GCC diagnostic push
86
86
// clang 7.0.0 and Apple LLVM 10.0.1 introduce `-Wself-assign-overloaded` to
87
87
// `-Wall`, which is used here for overloading (e.g. `py::self += py::self `).
@@ -221,6 +221,6 @@ TEST_SUBMODULE(operators, m) {
221
221
.def (py::self == py::self);
222
222
}
223
223
224
- #ifndef _MSC_VER
224
+ #if !defined( _MSC_VER) && !defined(__INTEL_COMPILER)
225
225
#pragma GCC diagnostic pop
226
226
#endif
You can’t perform that action at this time.
0 commit comments