See also: https://github.com/pybind/pybind11/issues/2583
Does not build with upstream master or
https://github.com/pybind/pybind11/pull/2047, but builds with
https://github.com/RobotLocomotion/pybind11 and almost runs:
```
Running tests in directory "/usr/local/google/home/rwgk/forked/EricCousineau-TRI/pybind11/tests":
================================================================================= test session starts =================================================================================
platform linux -- Python 3.8.5, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
rootdir: /usr/local/google/home/rwgk/forked/EricCousineau-TRI/pybind11/tests, inifile: pytest.ini
collected 2 items
test_unique_ptr_member.py .F [100%]
====================================================================================== FAILURES =======================================================================================
_____________________________________________________________________________ test_pointee_and_ptr_owner ______________________________________________________________________________
def test_pointee_and_ptr_owner():
obj = m.pointee()
assert obj.get_int() == 213
m.ptr_owner(obj)
with pytest.raises(ValueError) as exc_info:
> obj.get_int()
E Failed: DID NOT RAISE <class 'ValueError'>
test_unique_ptr_member.py:17: Failed
============================================================================= 1 failed, 1 passed in 0.06s =============================================================================
```
On Windows, clang-cl does not understand /MP.
```
clang-cl: warning: argument unused during compilation: '/MP' [-Wunused-command-line-argument]
```
with Clang 10.0.0
* Make sure all warnings in pytest get turned into errors
* Suppress DeprecationWarnings in test_int_convert and test_numpy_int_convert
* PyLong_AsLong only shouts "Deprecated!" on Python>=3.8
* Fix remaining warnings on PyPy and CPython 3.10-dev
* Demonstrate issue with weakref constructor overloads
* Fix weakref constructor to convert on being passed a non-weakref object
* Improve on nonlocal-scoped variable in test_weakref
* Keep backwards-compatibility by introducing PYBIND11_OBJECT_CVT_DEFAULT macro
* Simplify test_weakref
* Adding move_only_holder_caster `typename SFINAE = void` to enable external specializations.
* Adding SFINAE hook also to copyable_holder_caster, for uniformity, with comment to explain the purpose.
* When determining if a shared_ptr already exists, use a test on the weak_ptr instead of a try/catch block.
* When determining if a shared_ptr already exists, use a test on the weak_ptr instead of a try/catch block.
* weak_from_this is only available in C++17 and later
* Switch to use feature flag instead of C++ version flag.
* Add Microsoft-specific check.
* Avoid undefined preprocessor macro warning treated as error.
* Simplify shared_from_this in init_holder
* Include <version> in detail/common.h (~stolen~ borrowed from @bstaletic's #2816)
* Move class_::get_shared_from_this to detail::try_get_shared_from_this
* Simplify try_get_shared_from_this by using weak_ptr::lock()
Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net>
* Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8
* Fixed on PyPy
* Simplify use of PyNumber_Index, following @rwgk's idea, and ignore warnings in >=3.8
* Reproduce mismatch between pre-3.8 and post-3.8 behavior on __index__ throwing TypeError
* Fix tests on 3.6 <= Python < 3.8
* No, I don't have an uninitialized variable
* Fix use of __index__ on Python 2
* Make types in test_int_convert more ~boring~ descriptive