pybind11/tests
Ralf W. Grosse-Kunstleve da104a9efd
Reproducer and fix for issue encountered in smart_holder update. (#4228)
* Reproducer for issue encountered in smart_holder update.

* clang-tidy compatibility (untested).

* Add `enable_if_t` to workaround.

* Bug fix: Move `PYBIND11_USING_WORKAROUND_FOR_CUDA_11_4_THROUGH_8` determination to detail/common.h

So that it actually is defined in pybind11.h

* Try using the workaround (which is nicer than the original code) universally.

* Reduce reproducer for CUDA 11.7 issue encountered in smart_holder update.

This commit tested in isolation on top of current master + first version of reproducer (62311eb431).

Succeeds with Debian Clang 14.0.6 C++17 (and probably all other compilers).

Fails for CUDA 11.7:

```
cd /build/tests && /usr/local/cuda/bin/nvcc -forward-unknown-to-host-compiler -Dpybind11_tests_EXPORTS -I/mounted_pybind11/include -isystem=/usr/include/python3.10 -g --generate-code=arch=compute_52,code=[compute_52,sm_52] -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden -Werror all-warnings -std=c++17 -MD -MT tests/CMakeFiles/pybind11_tests.dir/test_class.cpp.o -MF CMakeFiles/pybind11_tests.dir/test_class.cpp.o.d -x cu -c /mounted_pybind11/tests/test_class.cpp -o CMakeFiles/pybind11_tests.dir/test_class.cpp.o
/mounted_pybind11/tests/test_class.cpp(53): error: more than one instance of overloaded function "pybind11::class_<type_, options...>::def [with type_=test_class::pr4220_tripped_over_this::Empty0, options=<>]" matches the argument list:
            function template "pybind11::class_<test_class::pr4220_tripped_over_this::Empty0> &pybind11::class_<type_, options...>::def(const char *, Func &&, const Extra &...) [with type_=test_class::pr4220_tripped_over_this::Empty0, options=<>]"
/mounted_pybind11/include/pybind11/pybind11.h(1557): here
            function template "pybind11::class_<test_class::pr4220_tripped_over_this::Empty0> &pybind11::class_<type_, options...>::def(const T &, const Extra &...) [with type_=test_class::pr4220_tripped_over_this::Empty0, options=<>]"
/mounted_pybind11/include/pybind11/pybind11.h(1586): here
            argument types are: (const char [8], <unknown-type>)
            object type is: pybind11::class_<test_class::pr4220_tripped_over_this::Empty0>

1 error detected in the compilation of "/mounted_pybind11/tests/test_class.cpp".
```
2022-10-09 21:50:35 -07:00
..
extra_python_package feat(cmake): add installation support for pkg-config dependency detection (#4077) 2022-08-09 00:02:45 -04:00
extra_setuptools chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_cmake_build chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_embed embed.h Python 3.11 config.use_environment=1 + PYTHONPATH test (#4119) 2022-08-21 09:44:01 -07:00
CMakeLists.txt Add error_scope to detail::get_internals() (#3981) 2022-05-31 11:51:13 -07:00
conftest.py Report C++ Info: via pytest_report_header() (#4046) 2022-07-07 17:51:44 -07:00
constructor_stats.h test: ConstructorStats newline (PyPy) (#4167) 2022-08-29 23:25:01 -04:00
cross_module_gil_utils.cpp chore: enable clang-tidy check modernize-use-nullptr (#3881) 2022-04-18 11:09:45 -04:00
cross_module_interleaved_error_already_set.cpp Add error_scope to detail::get_internals() (#3981) 2022-05-31 11:51:13 -07:00
env.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
local_bindings.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
object.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
pybind11_cross_module_tests.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
pybind11_tests.cpp Report C++ Info: via pytest_report_header() (#4046) 2022-07-07 17:51:44 -07:00
pybind11_tests.h Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
pytest.ini chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
requirements.txt Fix: 3.11 beta support (#3923) 2022-07-06 16:35:12 -04:00
test_async.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_async.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_buffers.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_buffers.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_builtin_casters.cpp Add -DPYBIND11_WERROR=ON to mingw cmake commands (#4073) 2022-08-01 06:18:48 -07:00
test_builtin_casters.py Cast bytearray to string (#3707) 2022-02-23 18:21:03 -05:00
test_call_policies.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_call_policies.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_callbacks.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_callbacks.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_chrono.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_chrono.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_class.cpp Reproducer and fix for issue encountered in smart_holder update. (#4228) 2022-10-09 21:50:35 -07:00
test_class.py Reproducer and fix for issue encountered in smart_holder update. (#4228) 2022-10-09 21:50:35 -07:00
test_const_name.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_const_name.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_constants_and_functions.cpp enable two new clang-tidy checks (#3988) 2022-06-06 12:15:45 -04:00
test_constants_and_functions.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_copy_move.cpp Fix py::cast from pytype rvalue to pytype (#3949) 2022-05-16 13:51:01 -07:00
test_copy_move.py Fix py::cast from pytype rvalue to pytype (#3949) 2022-05-16 13:51:01 -07:00
test_custom_type_casters.cpp Open pybind11 namespace with consistent visility. (#4098) 2022-08-01 11:31:31 -07:00
test_custom_type_casters.py cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) 2022-02-25 13:25:23 -08:00
test_custom_type_setup.cpp Add custom_type_setup attribute (#3287) 2021-09-24 12:08:22 -07:00
test_custom_type_setup.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_docstring_options.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_docstring_options.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_eigen.cpp test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 2022-10-07 09:20:38 -07:00
test_eigen.py test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 2022-10-07 09:20:38 -07:00
test_enum.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_enum.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_eval_call.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_eval.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_eval.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_exceptions.cpp For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 2022-07-21 06:38:00 -07:00
test_exceptions.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_exceptions.py [pre-commit.ci] pre-commit autoupdate (#4104) 2022-08-03 11:38:07 -04:00
test_factory_constructors.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_factory_constructors.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_gil_scoped.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_gil_scoped.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_iostream.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_iostream.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_kwargs_and_defaults.cpp More systematic gcc & clang coverage (#4083) 2022-07-21 06:40:34 -07:00
test_kwargs_and_defaults.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_local_bindings.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_local_bindings.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_methods_and_attributes.cpp Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 2022-05-02 15:30:19 -04:00
test_methods_and_attributes.py Fix: 3.11 beta support (#3923) 2022-07-06 16:35:12 -04:00
test_modules.cpp Add missing error handling to module_::def_submodule (#3973) 2022-05-28 16:40:57 -07:00
test_modules.py Add missing error handling to module_::def_submodule (#3973) 2022-05-28 16:40:57 -07:00
test_multiple_inheritance.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_multiple_inheritance.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_numpy_array.cpp fix: avoid catch (...) for expected import numpy failures (#3974) 2022-05-26 11:07:40 -04:00
test_numpy_array.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_numpy_dtypes.cpp fix: avoid catch (...) for expected import numpy failures (#3974) 2022-05-26 11:07:40 -04:00
test_numpy_dtypes.py Expand dtype accessors (#3868) 2022-04-14 10:53:16 -04:00
test_numpy_vectorize.cpp fix: avoid catch (...) for expected import numpy failures (#3974) 2022-05-26 11:07:40 -04:00
test_numpy_vectorize.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_opaque_types.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_opaque_types.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_operator_overloading.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_operator_overloading.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_pickling.cpp Test pickling a simple callable (does not work). (#3906) 2022-05-02 12:39:36 -07:00
test_pickling.py Test pickling a simple callable (does not work). (#3906) 2022-05-02 12:39:36 -07:00
test_pytypes.cpp fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 2022-10-07 12:27:54 -07:00
test_pytypes.py fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 2022-10-07 12:27:54 -07:00
test_sequences_and_iterators.cpp docs: Correct minor typos (#3721) 2022-02-11 10:42:48 -05:00
test_sequences_and_iterators.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_smart_ptr.cpp Open pybind11 namespace with consistent visility. (#4098) 2022-08-01 11:31:31 -07:00
test_smart_ptr.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_stl_binders.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_stl_binders.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_stl.cpp Open pybind11 namespace with consistent visility. (#4098) 2022-08-01 11:31:31 -07:00
test_stl.py Add anyset & frozenset, enable copying (cast) to std::set (#3901) 2022-05-05 12:09:56 -07:00
test_tagbased_polymorphic.cpp Open pybind11 namespace with consistent visility. (#4098) 2022-08-01 11:31:31 -07:00
test_tagbased_polymorphic.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_thread.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_thread.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_union.cpp Fix assertion failure for unions (#1685) (#1709) 2019-06-11 23:28:58 +02:00
test_union.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_virtual_functions.cpp chore: bump clang-tidy to 13 (#3997) 2022-07-13 09:06:32 -05:00
test_virtual_functions.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
valgrind-numpy-scipy.supp docs: fix various typos (#3075) 2021-07-04 19:58:35 -04:00
valgrind-python.supp chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 2021-01-31 17:29:09 -05:00