* Added arg/return type handling.
* Added support for nested arg/return type in py::typing::List
* Added support for arg/return type in stl/filesystem
* Added tests for arg/return type in stl/filesystem and py::typing::List
* Added arg/return name to more py::typing classes
* Added arg/return type to Callable[...]
* Added tests for typing container classes (also nested)
* Changed typing classes to avoid using C++14 auto return type deduction.
* Fixed clang-tidy errors.
* Changed Enable to SFINAE
* Added test for Tuple[T, ...]
* Added RealNumber with custom caster for testing typing classes.
* Added tests for Set, Iterable, Iterator, Union, and Optional
* Added tests for Callable
* Fixed Callable with ellipsis test
* Changed TypeGuard/TypeIs to use return type (being the narrower type) + Tests
* Added test for use of fallback type name with stl vector
* Updated documentation.
* Fixed unnecessary constructor call in test.
* Fixed reference counting in example type caster.
* Fixed clang-tidy issues.
* Fix for clang-tidy
* Updated cast method to use pybind11 API rather than Python C API in custom caster example
* Updated load to use pybind11 API rather than Python C API in custom caster example
* Changed test of arg/return name to use pybind11 API instead of Python C API
* Updated code in adcanced/cast example and improved documentation text
* Fixed references in custom type caster docs
* Fixed wrong logical and operator in test
* Fixed wrong logical operator in doc example
* Added comment to test about `float` vs `float | int`
* Updated std::filesystem::path docs in cast/overview section
* Remove one stray dot.
---------
Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
* fix: make PYBIND11_WARNING_POP actually pop clang diagnostics
* fix: ignore -Wgnu-zero-variadic-macro-arguments on clang
* Revert "fix: ignore -Wgnu-zero-variadic-macro-arguments on clang"
This reverts commit d310959bf5.
* C++20 modernization: Use `__VA_OPT__(, ) __VA_ARGS__` in `PYBIND11_DECLARE_HOLDER_TYPE()`
* Disable `__VA_OPT__(, ) __VA_ARGS__` usage for MSVC (it is unclear to rwgk why it does not work).
This is the beginning of the error message:
```
D:\a\pybind11\pybind11\tests\test_smart_ptr.cpp(285,1): error C2143: syntax error: missing ')' before ',' [D:\a\pybind11\pybind11\build\tests\pybind11_tests.vcxproj]
D:\a\pybind11\pybind11\tests\test_smart_ptr.cpp(285,1): error C2059: syntax error: ')' [D:\a\pybind11\pybind11\build\tests\pybind11_tests.vcxproj]
```
* Add `PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments")` in test_smart_ptr.cpp
This is the error message:
```
/__w/pybind11/pybind11/tests/test_smart_ptr.cpp:287:51: error: must specify at least one argument for '...' parameter of variadic macro [-Werror,-Wgnu-zero-variadic-macro-arguments]
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
^
/__w/pybind11/pybind11/include/pybind11/cast.h:885:13: note: macro 'PYBIND11_DECLARE_HOLDER_TYPE' defined here
^
```
* Also add `PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments")` in test_virtual_functions.cpp
* Also add `PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments")` in test_embed/test_interpreter.cpp
* Undo all changes except the original push -> pop fix.
* 1. Add `PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments")` near the top of pybind11/pybind11.h; 2. Change `PYBIND11_DECLARE_HOLDER_TYPE` macro to side-step the only remaining clang warning-as-error (this is still needed even for clang 18).
Alternatively the warning suppression could be moved into pybind11/cast.h, but this commit limits the warning suppression to smaller scope within include/pybind11.
---------
Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>