From 4038542b157d8e7ffd5c6f47166d9544fea03800 Mon Sep 17 00:00:00 2001 From: Boris Staletic Date: Wed, 21 Oct 2020 13:14:56 +0200 Subject: [PATCH] Remove friend declaration of py::class_ in py::detail::generic_type (#2613) This line had two bugs: 1. It declares `py::detail::class_` as `friend`. 2. After fixing that, we would have to change it to `template ` The first one was introduced ~5 years ago, when a large refactoring was made, probably as an intermediate step during refactoring. The second was made when `generic_type` was made to be agnostic with respect to the order of `py::class_` template parameters.   We're removing the declaration altogether, because it was never relied on. This is what makes me think that it was an intermediate step in refactoring that shouldn't have ended up in commit history. --- include/pybind11/pybind11.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index c63e7db7..fa98f7c1 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1027,7 +1027,6 @@ inline dict globals() { PYBIND11_NAMESPACE_BEGIN(detail) /// Generic support for creating new Python heap types class generic_type : public object { - template friend class class_; public: PYBIND11_OBJECT_DEFAULT(generic_type, object, PyType_Check) protected: