Skip to content

Commit 5f050c4

Browse files
committed
Merge branch 'master' into smart_holder
2 parents 49f8f60 + 62976cf commit 5f050c4

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

include/pybind11/pybind11.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ class cpp_function : public function {
113113
/* Without these pragmas, GCC warns that there might not be
114114
enough space to use the placement new operator. However, the
115115
'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)
117117
# pragma GCC diagnostic push
118118
# pragma GCC diagnostic ignored "-Wplacement-new"
119119
#endif
120120
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)
122122
# pragma GCC diagnostic pop
123123
#endif
124124
if (!std::is_trivially_destructible<Func>::value)
@@ -2347,6 +2347,6 @@ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
23472347

23482348
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
23492349
# pragma warning(pop)
2350-
#elif defined(__GNUG__) && !defined(__clang__)
2350+
#elif defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
23512351
# pragma GCC diagnostic pop
23522352
#endif

tests/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,15 @@ function(pybind11_enable_warnings target_name)
284284
target_compile_options(${target_name} PRIVATE /WX)
285285
elseif(PYBIND11_CUDA_TESTS)
286286
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)")
288288
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)
289296
endif()
290297
endif()
291298

tests/test_constants_and_functions.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ int f1(int x) noexcept { return x+1; }
5656
#endif
5757
int f2(int x) noexcept(true) { return x+2; }
5858
int f3(int x) noexcept(false) { return x+3; }
59-
#if defined(__GNUG__)
59+
#if defined(__GNUG__) && !defined(__INTEL_COMPILER)
6060
# pragma GCC diagnostic push
6161
# pragma GCC diagnostic ignored "-Wdeprecated"
6262
#endif
6363
int f4(int x) throw() { return x+4; } // Deprecated equivalent to noexcept(true)
64-
#if defined(__GNUG__)
64+
#if defined(__GNUG__) && !defined(__INTEL_COMPILER)
6565
# pragma GCC diagnostic pop
6666
#endif
6767
struct C {
@@ -71,13 +71,13 @@ struct C {
7171
int m4(int x) const noexcept(true) { return x-4; }
7272
int m5(int x) noexcept(false) { return x-5; }
7373
int m6(int x) const noexcept(false) { return x-6; }
74-
#if defined(__GNUG__)
74+
#if defined(__GNUG__) && !defined(__INTEL_COMPILER)
7575
# pragma GCC diagnostic push
7676
# pragma GCC diagnostic ignored "-Wdeprecated"
7777
#endif
7878
int m7(int x) throw() { return x-7; }
7979
int m8(int x) const throw() { return x-8; }
80-
#if defined(__GNUG__)
80+
#if defined(__GNUG__) && !defined(__INTEL_COMPILER)
8181
# pragma GCC diagnostic pop
8282
#endif
8383
};

tests/test_operator_overloading.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ std::string abs(const Vector2&) {
8080
return "abs(Vector2)";
8181
}
8282

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)
8585
#pragma GCC diagnostic push
8686
// clang 7.0.0 and Apple LLVM 10.0.1 introduce `-Wself-assign-overloaded` to
8787
// `-Wall`, which is used here for overloading (e.g. `py::self += py::self `).
@@ -221,6 +221,6 @@ TEST_SUBMODULE(operators, m) {
221221
.def(py::self == py::self);
222222
}
223223

224-
#ifndef _MSC_VER
224+
#if !defined(_MSC_VER) && !defined(__INTEL_COMPILER)
225225
#pragma GCC diagnostic pop
226226
#endif

0 commit comments

Comments
 (0)