Skip to content

Commit 6bfa0f1

Browse files
committed
Trying more after CI failure, adding push/pop to pybind11_tests.h, constructor_stats.h.
1 parent 3a4eb03 commit 6bfa0f1

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed

tests/constructor_stats.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ inspection/testing in python) by using the functions with `print_` replaced with
7070
#include <typeindex>
7171
#include <sstream>
7272

73+
#if defined(__INTEL_COMPILER)
74+
# pragma warning push
75+
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
76+
#endif
77+
7378
class ConstructorStats {
7479
protected:
7580
std::unordered_map<void*, int> _instances; // Need a map rather than set because members can shared address with parents
@@ -273,3 +278,7 @@ template <class T, typename... Values> void print_values(T *inst, Values &&...va
273278
print_constr_details(inst, ":", values...);
274279
track_values(inst, values...);
275280
}
281+
282+
#if defined(__INTEL_COMPILER)
283+
# pragma warning pop
284+
#endif

tests/pybind11_cross_module_tests.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
BSD-style license that can be found in the LICENSE file.
88
*/
99

10-
#if defined(__INTEL_COMPILER)
11-
# pragma warning push
12-
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
13-
#endif
14-
1510
#include "pybind11_tests.h"
1611
#include "local_bindings.h"
1712
#include "test_exceptions.h"
@@ -21,6 +16,11 @@
2116
#include <numeric>
2217
#include <utility>
2318

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

tests/pybind11_tests.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
BSD-style license that can be found in the LICENSE file.
88
*/
99

10-
#if defined(__INTEL_COMPILER)
11-
# pragma warning push
12-
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
13-
#endif
14-
1510
#include "pybind11_tests.h"
1611
#include "constructor_stats.h"
1712

1813
#include <functional>
1914
#include <list>
2015

16+
#if defined(__INTEL_COMPILER)
17+
# pragma warning push
18+
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
19+
#endif
20+
2121
/*
2222
For testing purposes, we define a static global variable here in a function that each individual
2323
test .cpp calls with its initialization lambda. It's convenient here because we can just not

tests/pybind11_tests.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
// We get some really long type names here which causes MSVC 2015 to emit warnings
1111
# pragma warning( \
1212
disable : 4503) // warning C4503: decorated name length exceeded, name was truncated
13+
#elif defined(__INTEL_COMPILER)
14+
# pragma warning push
15+
# pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
1316
#endif
1417

1518
namespace py = pybind11;
@@ -87,3 +90,9 @@ void ignoreOldStyleInitWarnings(F &&body) {
8790
body()
8891
)", py::dict(py::arg("body") = py::cpp_function(body)));
8992
}
93+
94+
#if defined(_MSC_VER) && _MSC_VER < 1910
95+
# pragma warning(pop)
96+
#elif defined(__INTEL_COMPILER)
97+
# pragma warning pop
98+
#endif

0 commit comments

Comments
 (0)