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 @@ -113,12 +113,12 @@ class cpp_function : public function {
113
113
/* Without these pragmas, GCC warns that there might not be
114
114
enough space to use the placement new operator. However, the
115
115
'if' statement above ensures that this is the case. */
116
- #if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 6
116
+ #if defined(__GNUG__) && __GNUC__ >= 6 && !defined(__clang__) && !defined(__INTEL_COMPILER)
117
117
# pragma GCC diagnostic push
118
118
# pragma GCC diagnostic ignored "-Wplacement-new"
119
119
#endif
120
120
new ((capture *) &rec->data ) capture { std::forward<Func>(f) };
121
- #if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 6
121
+ #if defined(__GNUG__) && __GNUC__ >= 6 && !defined(__clang__) && !defined(__INTEL_COMPILER)
122
122
# pragma GCC diagnostic pop
123
123
#endif
124
124
if (!std::is_trivially_destructible<Func>::value)
@@ -2347,6 +2347,6 @@ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
2347
2347
2348
2348
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
2349
2349
# pragma warning(pop)
2350
- #elif defined(__GNUG__) && !defined(__clang__)
2350
+ #elif defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
2351
2351
# pragma GCC diagnostic pop
2352
2352
#endif
Original file line number Diff line number Diff line change @@ -284,8 +284,15 @@ function(pybind11_enable_warnings target_name)
284
284
target_compile_options (${target_name} PRIVATE /WX)
285
285
elseif (PYBIND11_CUDA_TESTS)
286
286
target_compile_options (${target_name} PRIVATE "SHELL:-Werror all-warnings" )
287
- elseif (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel| Clang)" )
287
+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang|IntelLLVM )" )
288
288
target_compile_options (${target_name} PRIVATE -Werror)
289
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" )
290
+ target_compile_options (
291
+ ${target_name}
292
+ PRIVATE
293
+ -Werror-all
294
+ # "Inlining inhibited by limit max-size", "Inlining inhibited by limit max-total-size"
295
+ -diag-disable 11074,11076)
289
296
endif ()
290
297
endif ()
291
298
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