Skip to content

Commit f381a34

Browse files
committed
Add C4275 warning suppressions for _MSC_VER
1 parent c9abf79 commit f381a34

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/cross_module_exception_odr_1.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44

55
namespace cross_module_exception_odr {
66

7+
#if defined(_MSC_VER)
8+
# pragma warning(push)
9+
# pragma warning(disable : 4275)
10+
#endif
11+
712
class PYBIND11_EXPORT_EXCEPTION evolving : public std::runtime_error {
813
public:
914
explicit evolving(const std::string &msg) : std::runtime_error("v1:" + msg) {}
1015
};
1116

17+
#if defined(_MSC_VER)
18+
# pragma warning(pop)
19+
#endif
20+
1221
} // namespace cross_module_exception_odr
1322

1423
PYBIND11_MODULE(cross_module_exception_odr_1, m) {

tests/cross_module_exception_odr_2.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44

55
namespace cross_module_exception_odr {
66

7+
#if defined(_MSC_VER)
8+
# pragma warning(push)
9+
# pragma warning(disable : 4275)
10+
#endif
11+
712
class PYBIND11_EXPORT_EXCEPTION evolving : public std::exception {
813
public:
914
const char *what() const noexcept override { return "v2"; }
1015
};
1116

17+
#if defined(_MSC_VER)
18+
# pragma warning(pop)
19+
#endif
20+
1221
void raise_evolving_from_module_2() { throw evolving(); }
1322

1423
} // namespace cross_module_exception_odr

0 commit comments

Comments
 (0)