Bug fixes: Add missing handle_type_name
specializations.
#5073
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a number of missing
handle_type_name
specializations that have accumulated over time unnoticed, until work under #4888 exposed the issue. This PR is based on #4888, but omits behavior changes other than the pure bug fixes.To prevent future accumulation of missing
handle_type_name
specializations, this PR adds the-DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION
cmake option, which isOFF
by default, but set toON
for some (but not all) ci.yml jobs. WhenON
, missinghandle_type_name
specializations trigger compilation errors.The
quote_cpp_type_name()
function introduced in #4888 is included here, but with the implementation changed to a no-op. This pin-points where C++ type names "slip through" (and could confuse stubgen), and enables easy future experimentation similar to #4888.Caveat: The test coverage for the
handle_type_name
specializations is incomplete: while the-DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION
option ensures that no specializations are missing, some of thename
s could be changed without triggering unit test failures.Suggested changelog entry: