From 1b72808e6f836dd49ab256139f4f28f5b9f2dc25 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 11 Oct 2021 12:10:36 -0700 Subject: [PATCH] For MSVC 2015 only: also adding the C4127 suppression to test_eigen.cpp --- include/pybind11/eigen.h | 2 +- tests/test_eigen.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/pybind11/eigen.h b/include/pybind11/eigen.h index d2aac58db9..a8e749a316 100644 --- a/include/pybind11/eigen.h +++ b/include/pybind11/eigen.h @@ -24,7 +24,7 @@ // it is probably best to keep this around indefinitely. #if defined(_MSC_VER) # pragma warning(push) -# pragma warning(disable: 4127) +# pragma warning(disable: 4127) // C4127: conditional expression is constant #endif #include diff --git a/tests/test_eigen.cpp b/tests/test_eigen.cpp index ad572b2ad7..d22a94a1a1 100644 --- a/tests/test_eigen.cpp +++ b/tests/test_eigen.cpp @@ -13,6 +13,9 @@ #include #if defined(_MSC_VER) +#if _MSC_VER < 1910 // VS 2015's MSVC +# pragma warning(disable: 4127) // C4127: conditional expression is constant +#endif # pragma warning(disable: 4996) // C4996: std::unary_negation is deprecated #endif