From 2a26873727214c5f1e159cba98f5c625b908381a Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sat, 12 Feb 2022 08:08:12 -0800 Subject: [PATCH] Manual pass looking for "2015", builds & tests with unix_clang, before pre-commit. --- README.rst | 2 +- docs/advanced/cast/stl.rst | 2 -- docs/advanced/classes.rst | 7 ------- docs/basics.rst | 3 +-- docs/classes.rst | 3 +-- docs/faq.rst | 14 -------------- docs/upgrade.rst | 2 +- include/pybind11/attr.h | 5 ++--- include/pybind11/detail/common.h | 12 +----------- include/pybind11/functional.h | 3 +-- tests/test_constants_and_functions.cpp | 2 +- tests/test_virtual_functions.cpp | 3 +-- 12 files changed, 10 insertions(+), 48 deletions(-) diff --git a/README.rst b/README.rst index 0edcd9179a..3c75edb575 100644 --- a/README.rst +++ b/README.rst @@ -122,7 +122,7 @@ Supported compilers 1. Clang/LLVM 3.3 or newer (for Apple Xcode's clang, this is 5.0.0 or newer) 2. GCC 4.8 or newer -3. Microsoft Visual Studio 2015 Update 3 or newer +3. Microsoft Visual Studio 2017 or newer 4. Intel classic C++ compiler 18 or newer (ICC 20.2 tested in CI) 5. Cygwin/GCC (previously tested on 2.5.1) 6. NVCC (CUDA 11.0 tested in CI) diff --git a/docs/advanced/cast/stl.rst b/docs/advanced/cast/stl.rst index b8622ee095..109763f7aa 100644 --- a/docs/advanced/cast/stl.rst +++ b/docs/advanced/cast/stl.rst @@ -87,8 +87,6 @@ included to tell pybind11 how to visit the variant. pybind11 only supports the modern implementation of ``boost::variant`` which makes use of variadic templates. This requires Boost 1.56 or newer. - Additionally, on Windows, MSVC 2017 is required because ``boost::variant`` - falls back to the old non-variadic implementation on MSVC 2015. .. _opaque: diff --git a/docs/advanced/classes.rst b/docs/advanced/classes.rst index 3e8ba73852..49ddf5c0b1 100644 --- a/docs/advanced/classes.rst +++ b/docs/advanced/classes.rst @@ -1118,13 +1118,6 @@ described trampoline: py::class_(m, "A") // <-- `Trampoline` here .def("foo", &Publicist::foo); // <-- `Publicist` here, not `Trampoline`! -.. note:: - - MSVC 2015 has a compiler bug (fixed in version 2017) which - requires a more explicit function binding in the form of - ``.def("foo", static_cast(&Publicist::foo));`` - where ``int (A::*)() const`` is the type of ``A::foo``. - Binding final classes ===================== diff --git a/docs/basics.rst b/docs/basics.rst index d40992d386..e9b24c7fa7 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -32,8 +32,7 @@ The last line will both compile and run the tests. Windows ------- -On Windows, only **Visual Studio 2015** and newer are supported since pybind11 relies -on various C++11 language features that break older versions of Visual Studio. +On Windows, only **Visual Studio 2017** and newer are supported. .. Note:: diff --git a/docs/classes.rst b/docs/classes.rst index b833bc4ba1..0c687b7c53 100644 --- a/docs/classes.rst +++ b/docs/classes.rst @@ -434,8 +434,7 @@ you can use ``py::detail::overload_cast_impl`` with an additional set of parenth .def("set", overload_cast_()(&Pet::set), "Set the pet's age") .def("set", overload_cast_()(&Pet::set), "Set the pet's name"); -.. [#cpp14] A compiler which supports the ``-std=c++14`` flag - or Visual Studio 2015 Update 2 and newer. +.. [#cpp14] A compiler which supports the ``-std=c++14`` flag. .. note:: diff --git a/docs/faq.rst b/docs/faq.rst index a6b9913126..28498e7dfc 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -220,20 +220,6 @@ In addition to decreasing binary size, ``-fvisibility=hidden`` also avoids potential serious issues when loading multiple modules and is required for proper pybind operation. See the previous FAQ entry for more details. -Working with ancient Visual Studio 2008 builds on Windows -========================================================= - -The official Windows distributions of Python are compiled using truly -ancient versions of Visual Studio that lack good C++11 support. Some users -implicitly assume that it would be impossible to load a plugin built with -Visual Studio 2015 into a Python distribution that was compiled using Visual -Studio 2008. However, no such issue exists: it's perfectly legitimate to -interface DLLs that are built with different compilers and/or C libraries. -Common gotchas to watch out for involve not ``free()``-ing memory region -that that were ``malloc()``-ed in another shared library, using data -structures with incompatible ABIs, and so on. pybind11 is very careful not -to make these types of mistakes. - How can I properly handle Ctrl-C in long-running functions? =========================================================== diff --git a/docs/upgrade.rst b/docs/upgrade.rst index 6a9db2d08f..77382da7c8 100644 --- a/docs/upgrade.rst +++ b/docs/upgrade.rst @@ -411,7 +411,7 @@ error is raised if the compiler does not meet the requirements: * GCC >= 4.8 * clang >= 3.3 (appleclang >= 5.0) -* MSVC >= 2015u3 +* MSVC >= 2017 * Intel C++ >= 15.0 diff --git a/include/pybind11/attr.h b/include/pybind11/attr.h index de95f89d0f..38139afa32 100644 --- a/include/pybind11/attr.h +++ b/include/pybind11/attr.h @@ -61,7 +61,7 @@ struct base { PYBIND11_DEPRECATED( "base() was deprecated in favor of specifying 'T' as a template argument to class_") - base() {} // NOLINT(modernize-use-equals-default): breaks MSVC 2015 when adding an attribute + base() = default; }; /// Keep patient alive while nurse lives @@ -82,8 +82,7 @@ struct metaclass { handle value; PYBIND11_DEPRECATED("py::metaclass() is no longer required. It's turned on by default now.") - // NOLINTNEXTLINE(modernize-use-equals-default): breaks MSVC 2015 when adding an attribute - metaclass() {} + metaclass() = default; /// Override pybind11's default metaclass explicit metaclass(handle value) : value(value) {} diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 947ef4a0e1..d33092c5ae 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -822,14 +822,8 @@ struct is_template_base_of_impl { /// Check if a template is the base of a type. For example: /// `is_template_base_of` is true if `struct T : Base {}` where U can be anything template