Remove object::borrowed/stolen

PR #771 deprecated them as they can cause linking failures (#770), but
the deprecation tags cause warnings on GCC 5.x through 6.2.x.  Removing
them entirely will break backwards-compatibility consequences, but the
effects should be minimal (only code that was inheriting from `object`
could get at them at all as they are protected).

Fixes #777
This commit is contained in:
Jason Rhinelander 2017-04-06 18:31:21 -04:00
parent 555dc4f07a
commit 16c86638a5

View File

@ -236,11 +236,6 @@ protected:
// Tags for choosing constructors from raw PyObject *
struct borrowed_t { };
struct stolen_t { };
// These can cause linkage problems; see #770
PYBIND11_DEPRECATED("Use of the `borrowed` static variable is deprecated; use `borrowed_t{}' instead")
static constexpr borrowed_t borrowed{};
PYBIND11_DEPRECATED("Use of the `stolen` static variable is deprecated; use `stolen_t{}' instead")
static constexpr stolen_t stolen{};
template <typename T> friend T reinterpret_borrow(handle);
template <typename T> friend T reinterpret_steal(handle);