Skip to content

Commit cbb29c0

Browse files
committed
pragma warning(disable : 5054) in eigen.h
1 parent 533e5ad commit cbb29c0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

include/pybind11/detail/common.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,9 @@ struct is_template_base_of_impl {
822822
/// Check if a template is the base of a type. For example:
823823
/// `is_template_base_of<Base, T>` is true if `struct T : Base<U> {}` where U can be anything
824824
template <template <typename...> class Base, typename T>
825-
#if defined(PYBIND11_CPP20) || !defined(_MSC_VER) // Sadly, all MSVC versions incl. 2022 need this.
825+
// Sadly, all MSVC versions incl. 2022 need the workaround, even in C++20 mode.
826+
// See also: https://github.com/pybind/pybind11/pull/3741
827+
#if !defined(_MSC_VER)
826828
using is_template_base_of
827829
= decltype(is_template_base_of_impl<Base>::check((intrinsic_t<T> *) nullptr));
828830
#else

include/pybind11/eigen.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
// make it version specific, or even remove it later, but considering that
2222
// 1. C4127 is generally far more distracting than useful for modern template code, and
2323
// 2. we definitely want to ignore any MSVC warnings originating from Eigen code,
24-
// it is probably best to keep this around indefinitely.
24+
// it is probably best to keep this around indefinitely.
2525
#if defined(_MSC_VER)
2626
# pragma warning(push)
2727
# pragma warning(disable : 4127) // C4127: conditional expression is constant
28+
# pragma warning(disable : 5054) // https://github.com/pybind/pybind11/pull/3741
29+
// C5054: operator '&': deprecated between enumerations of different types
2830
#endif
2931

3032
#include <Eigen/Core>

0 commit comments

Comments
 (0)