Skip to content

Commit a2e034b

Browse files
committed
fix MSVC build
1 parent 2f22f29 commit a2e034b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/pybind11/detail/common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,13 +723,20 @@ using expand_side_effects = bool[];
723723

724724
PYBIND11_NAMESPACE_END(detail)
725725

726+
#if defined(_MSC_VER)
727+
# pragma warning(push)
728+
# pragma warning(disable: 4275) // warning C4275: An exported class was derived from a class that wasn't exported. Can be ignored when derived from a STL class.
729+
#endif
726730
/// C++ bindings of builtin Python exceptions
727731
class PYBIND11_EXPORT builtin_exception : public std::runtime_error {
728732
public:
729733
using std::runtime_error::runtime_error;
730734
/// Set the error using the Python C API
731735
virtual void set_error() const = 0;
732736
};
737+
#if defined(_MSC_VER)
738+
# pragma warning(pop)
739+
#endif
733740

734741
#define PYBIND11_RUNTIME_EXCEPTION(name, type) \
735742
class PYBIND11_EXPORT name : public builtin_exception { public: \

0 commit comments

Comments
 (0)