Repository navigation
fix: clear compiler diagnostics in override lookup - #6332
Merged
Merged
Conversation
Keep the ownership-dependent reference acquisition in the result expression and branch on the returned pointer. This avoids a constant if condition for borrowed lookup while preserving reference acquisition under the instance-map lock. Let the cast deduce the GIL-path owner type for clang-tidy. Validated the focused override and shared-pointer tests on both Python 3.15 variants, C++11 compilation with Python 3.9 headers, and repository lint. Assisted-by: Codex:GPT-6.2-Sol
Test an ordinary boolean variable to avoid the MSVC constant-condition warning. Preserve short-circuit evaluation and keep the reference acquisition under the map lock. Assisted-by: Codex:GPT-6.2-Sol
Restore the original lookup condition and apply the existing C4127 diagnostic macro within a balanced push/pop. The warning settings are restored after get_object_impl. Assisted-by: Codex:GPT-6.2-Sol
Collaborator
Author
|
— codex GPT-6.2-Sol on behalf of Ralf — @henryiii I’ll go ahead and merge this to get CI on |
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.
— codex GPT-6.2-Sol on behalf of Ralf —
Description
The full matrix on #6331 exposed two diagnostics in code that landed via #6249. MSVC reports C4127 when the borrowed lookup makes the
ifcondition constant. Keep the original condition and use the existing warning macros to suppress C4127 withinget_object_impl. Useautofor the owner initialized byreinterpret_borrow<object>to satisfy Clang-Tidy.The last full CI run on #6249 passed on a revision that preceded the lookup refactor. Full CI was deferred for re-review on the final revision, so the compiler checks did not run against that refactor before the merge.
Local validation passed for the existing override lifetime and shared-pointer tests on Python 3.15.2 with GIL and free-threaded (10 tests each), Clang C++11 compilation against Python 3.9 headers, and repository lint. The ready-for-review CI run will cover the affected MSVC and Clang-Tidy jobs.