Skip to content

Commit d7967a8

Browse files
committed
Adding push/pop to 3 tests. Removing pybind#878 from top of pybind11.h (it was/is only needed for 1 test).
1 parent 87b3181 commit d7967a8

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

include/pybind11/pybind11.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//
1616
#if defined(__INTEL_COMPILER)
1717
# pragma warning push
18-
# pragma warning disable 878 // incompatible exception specifications
1918
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
2019
#elif defined(_MSC_VER)
2120
# pragma warning(push)

tests/pybind11_cross_module_tests.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
#include <numeric>
1717
#include <utility>
1818

19+
#if defined(__INTEL_COMPILER)
20+
# pragma warning push
21+
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
22+
#endif
1923
PYBIND11_MODULE(pybind11_cross_module_tests, m) {
2024
m.doc() = "pybind11 cross-module test module";
2125

@@ -149,3 +153,6 @@ PYBIND11_MODULE(pybind11_cross_module_tests, m) {
149153
m.def("missing_header_arg", [](const std::vector<float> &) {});
150154
m.def("missing_header_return", []() { return std::vector<float>(); });
151155
}
156+
#if defined(__INTEL_COMPILER)
157+
# pragma warning pop
158+
#endif

tests/pybind11_tests.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ void bind_ConstructorStats(py::module_ &m) {
6262
;
6363
}
6464

65+
#if defined(__INTEL_COMPILER)
66+
# pragma warning push
67+
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
68+
#endif
6569
PYBIND11_MODULE(pybind11_tests, m) {
6670
m.doc() = "pybind11 test module";
6771

@@ -89,3 +93,6 @@ PYBIND11_MODULE(pybind11_tests, m) {
8993
for (const auto &initializer : initializers())
9094
initializer(m);
9195
}
96+
#if defined(__INTEL_COMPILER)
97+
# pragma warning pop
98+
#endif

tests/test_constants_and_functions.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,14 @@ TEST_SUBMODULE(constants_and_functions, m) {
133133
;
134134
m.def("f1", f1);
135135
m.def("f2", f2);
136+
#if defined(__INTEL_COMPILER)
137+
# pragma warning push
138+
# pragma warning disable 878 // incompatible exception specifications
139+
#endif
136140
m.def("f3", f3);
141+
#if defined(__INTEL_COMPILER)
142+
# pragma warning pop
143+
#endif
137144
m.def("f4", f4);
138145

139146
// test_function_record_leaks

0 commit comments

Comments
 (0)