Skip to content

Commit 2a26873

Browse files
committed
Manual pass looking for "2015", builds & tests with unix_clang, before pre-commit.
1 parent d078658 commit 2a26873

File tree

12 files changed

+10
-48
lines changed

12 files changed

+10
-48
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Supported compilers
122122
1. Clang/LLVM 3.3 or newer (for Apple Xcode's clang, this is 5.0.0 or
123123
newer)
124124
2. GCC 4.8 or newer
125-
3. Microsoft Visual Studio 2015 Update 3 or newer
125+
3. Microsoft Visual Studio 2017 or newer
126126
4. Intel classic C++ compiler 18 or newer (ICC 20.2 tested in CI)
127127
5. Cygwin/GCC (previously tested on 2.5.1)
128128
6. NVCC (CUDA 11.0 tested in CI)

docs/advanced/cast/stl.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ included to tell pybind11 how to visit the variant.
8787

8888
pybind11 only supports the modern implementation of ``boost::variant``
8989
which makes use of variadic templates. This requires Boost 1.56 or newer.
90-
Additionally, on Windows, MSVC 2017 is required because ``boost::variant``
91-
falls back to the old non-variadic implementation on MSVC 2015.
9290

9391
.. _opaque:
9492

docs/advanced/classes.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,13 +1118,6 @@ described trampoline:
11181118
py::class_<A, Trampoline>(m, "A") // <-- `Trampoline` here
11191119
.def("foo", &Publicist::foo); // <-- `Publicist` here, not `Trampoline`!
11201120
1121-
.. note::
1122-
1123-
MSVC 2015 has a compiler bug (fixed in version 2017) which
1124-
requires a more explicit function binding in the form of
1125-
``.def("foo", static_cast<int (A::*)() const>(&Publicist::foo));``
1126-
where ``int (A::*)() const`` is the type of ``A::foo``.
1127-
11281121
Binding final classes
11291122
=====================
11301123

docs/basics.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ The last line will both compile and run the tests.
3232
Windows
3333
-------
3434

35-
On Windows, only **Visual Studio 2015** and newer are supported since pybind11 relies
36-
on various C++11 language features that break older versions of Visual Studio.
35+
On Windows, only **Visual Studio 2017** and newer are supported.
3736

3837
.. Note::
3938

docs/classes.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,7 @@ you can use ``py::detail::overload_cast_impl`` with an additional set of parenth
434434
.def("set", overload_cast_<int>()(&Pet::set), "Set the pet's age")
435435
.def("set", overload_cast_<const std::string &>()(&Pet::set), "Set the pet's name");
436436
437-
.. [#cpp14] A compiler which supports the ``-std=c++14`` flag
438-
or Visual Studio 2015 Update 2 and newer.
437+
.. [#cpp14] A compiler which supports the ``-std=c++14`` flag.
439438
440439
.. note::
441440

docs/faq.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,20 +220,6 @@ In addition to decreasing binary size, ``-fvisibility=hidden`` also avoids
220220
potential serious issues when loading multiple modules and is required for
221221
proper pybind operation. See the previous FAQ entry for more details.
222222

223-
Working with ancient Visual Studio 2008 builds on Windows
224-
=========================================================
225-
226-
The official Windows distributions of Python are compiled using truly
227-
ancient versions of Visual Studio that lack good C++11 support. Some users
228-
implicitly assume that it would be impossible to load a plugin built with
229-
Visual Studio 2015 into a Python distribution that was compiled using Visual
230-
Studio 2008. However, no such issue exists: it's perfectly legitimate to
231-
interface DLLs that are built with different compilers and/or C libraries.
232-
Common gotchas to watch out for involve not ``free()``-ing memory region
233-
that that were ``malloc()``-ed in another shared library, using data
234-
structures with incompatible ABIs, and so on. pybind11 is very careful not
235-
to make these types of mistakes.
236-
237223
How can I properly handle Ctrl-C in long-running functions?
238224
===========================================================
239225

docs/upgrade.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ error is raised if the compiler does not meet the requirements:
411411

412412
* GCC >= 4.8
413413
* clang >= 3.3 (appleclang >= 5.0)
414-
* MSVC >= 2015u3
414+
* MSVC >= 2017
415415
* Intel C++ >= 15.0
416416

417417

include/pybind11/attr.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct base {
6161

6262
PYBIND11_DEPRECATED(
6363
"base<T>() was deprecated in favor of specifying 'T' as a template argument to class_")
64-
base() {} // NOLINT(modernize-use-equals-default): breaks MSVC 2015 when adding an attribute
64+
base() = default;
6565
};
6666

6767
/// Keep patient alive while nurse lives
@@ -82,8 +82,7 @@ struct metaclass {
8282
handle value;
8383

8484
PYBIND11_DEPRECATED("py::metaclass() is no longer required. It's turned on by default now.")
85-
// NOLINTNEXTLINE(modernize-use-equals-default): breaks MSVC 2015 when adding an attribute
86-
metaclass() {}
85+
metaclass() = default;
8786

8887
/// Override pybind11's default metaclass
8988
explicit metaclass(handle value) : value(value) {}

include/pybind11/detail/common.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -822,14 +822,8 @@ 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(_MSC_VER)
826825
using is_template_base_of
827826
= decltype(is_template_base_of_impl<Base>::check((intrinsic_t<T> *) nullptr));
828-
#else // MSVC2015 has trouble with decltype in template aliases
829-
struct is_template_base_of
830-
: decltype(is_template_base_of_impl<Base>::check((intrinsic_t<T> *) nullptr)) {
831-
};
832-
#endif
833827

834828
/// Check if T is an instantiation of the template `Class`. For example:
835829
/// `is_instantiation<shared_ptr, T>` is true if `T == shared_ptr<U>` where U can be anything.
@@ -1000,9 +994,6 @@ struct nodelete {
1000994
PYBIND11_NAMESPACE_BEGIN(detail)
1001995
template <typename... Args>
1002996
struct overload_cast_impl {
1003-
// NOLINTNEXTLINE(modernize-use-equals-default): MSVC 2015 needs this
1004-
constexpr overload_cast_impl() {}
1005-
1006997
template <typename Return>
1007998
constexpr auto operator()(Return (*pf)(Args...)) const noexcept -> decltype(pf) {
1008999
return pf;
@@ -1029,8 +1020,7 @@ PYBIND11_NAMESPACE_END(detail)
10291020
/// - regular: static_cast<Return (Class::*)(Arg0, Arg1, Arg2)>(&Class::func)
10301021
/// - sweet: overload_cast<Arg0, Arg1, Arg2>(&Class::func)
10311022
template <typename... Args>
1032-
static constexpr detail::overload_cast_impl<Args...> overload_cast = {};
1033-
// MSVC 2015 only accepts this particular initialization syntax for this variable template.
1023+
static constexpr detail::overload_cast_impl<Args...> overload_cast;
10341024
#endif
10351025

10361026
/// Const member function selector for overload_cast

include/pybind11/functional.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ struct type_caster<std::function<Return(Args...)>> {
9999
Return operator()(Args... args) const {
100100
gil_scoped_acquire acq;
101101
object retval(hfunc.f(std::forward<Args>(args)...));
102-
/* Visual studio 2015 parser issue: need parentheses around this expression */
103-
return (retval.template cast<Return>());
102+
return retval.template cast<Return>();
104103
}
105104
};
106105

tests/test_constants_and_functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ TEST_SUBMODULE(constants_and_functions, m) {
143143
uint64_t zeros[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
144144
};
145145
m.def("register_large_capture_with_invalid_arguments", [](py::module_ m) {
146-
LargeCapture capture; // VS 2015's MSVC is acting up if we create the array here
146+
LargeCapture capture; // VS 2015's MSVC was acting up when creating the array here
147147
m.def(
148148
"should_raise",
149149
[capture](int) { return capture.zeros[9] + 33; },

tests/test_virtual_functions.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ class NCVirtTrampoline : public NCVirt {
154154
};
155155

156156
struct Base {
157-
/* for some reason MSVC2015 can't compile this if the function is pure virtual */
158-
virtual std::string dispatch() const { return {}; };
157+
virtual std::string dispatch() const = 0;
159158
virtual ~Base() = default;
160159
Base() = default;
161160
Base(const Base &) = delete;

0 commit comments

Comments
 (0)