[feat/precompile-pytypes] feat: move detail/class.h definitions to class-inl.h - #6133
Open
henryiii wants to merge 3 commits into
Open
[feat/precompile-pytypes] feat: move detail/class.h definitions to class-inl.h#6133henryiii wants to merge 3 commits into
henryiii wants to merge 3 commits into
Conversation
henryiii
force-pushed
the
feat/precompile-class
branch
from
August 7, 2026 03:27
4bc74d7 to
5dc5230
Compare
All 32 functions in detail/class.h are non-template plumbing (type/slot machinery); move them out of line for the precompiled mode. Forward declarations of these functions in other headers lose their inline keyword to stay ODR-consistent in both modes. Assisted-by: ClaudeCode:claude-fable-5
Several functions are forward-declared in headers that cannot include class.h; GCC's -Wredundant-decls (used in CI cxx_flags) flags the second declaration. Assisted-by: ClaudeCode:claude-fable-5
henryiii
force-pushed
the
feat/precompile-class
branch
from
August 7, 2026 03:33
5dc5230 to
2b52ce3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🤖 AI text below 🤖
Description
Stacked on #6132. Second slice of the pre-compilation split: all 32 functions in
detail/class.hare non-template type/slot plumbing (make_new_python_type, metaclass andtp_*slot implementations, instance registration), so the whole implementation (~730 lines) moves todetail/class-inl.hvia thePYBIND11_INLINEmechanism from #6132. The header keeps the macros and declarations; slot functions are only used by address, so behavior is identical.Forward declarations of these functions in
trampoline_self_life_support.h,cpp_conduit.h,internals.h, andtype_caster_base.hlose theirinlinekeyword — required for ODR consistency in precompiled mode (caught by-Wundefined-inlineunder-Werror).Verified: full test suite passes in both modes; test binary size unchanged in header-only mode.
Suggested changelog entry:
📚 Documentation preview 📚: https://pybind11--6133.org.readthedocs.build/