Add C++23 deducing this tests (test_cpp23features.py)#226
Merged
Vipul-Cariappa merged 1 commit intoJun 11, 2026
Conversation
Exercise C++23 explicit object parameters (P0847R7) end-to-end through the interpreter (clang-repl and cling). C++23 isn't the stack default and the interpreter is a process-wide singleton pinned at first `import cppyy`, so TestCPP23Driver re-runs the class once in a child process that selects C++23 before import; all tests share that one interpreter. Bodies are ordinary Python; only the cppdef C++ source is a string. Covers the language mechanics (basic, const, by-value, extra-args, rvalue-ref, chaining, default arg, call operator, mixed overload, templated, abbreviated `this auto&&`, inheritance) and the use-cases from the MSVC "Deducing this" blog post. Co-developed-with-the-help-of: Claude Code (Claude Opus 4.8)
29748cf to
2d516c7
Compare
Author
|
@Vipul-Cariappa @aaronj0 @vgvassilev this looks green now with the other PR landing for CppInterOp, this is just new test to exercise the deducing this from cppyy side |
Vipul-Cariappa
approved these changes
Jun 11, 2026
Collaborator
There was a problem hiding this comment.
The CI logs say:
test_cpp23features.py::TestCPP23FEATURES::test01_deducing_this_basic SKIPPED [ 13%]
test_cpp23features.py::TestCPP23FEATURES::test02_deducing_this_const SKIPPED [ 13%]
test_cpp23features.py::TestCPP23FEATURES::test03_deducing_this_by_value SKIPPED [ 13%]
test_cpp23features.py::TestCPP23FEATURES::test04_deducing_this_with_extra_args SKIPPED [ 13%]
test_cpp23features.py::TestCPP23FEATURES::test05_deducing_this_rvalue_ref SKIPPED [ 14%]
test_cpp23features.py::TestCPP23FEATURES::test05b_traditional_rvalue_ref_qualifier SKIPPED [ 14%]
test_cpp23features.py::TestCPP23FEATURES::test06_deducing_this_chaining SKIPPED [ 14%]
test_cpp23features.py::TestCPP23FEATURES::test07_deducing_this_default_arg SKIPPED [ 14%]
test_cpp23features.py::TestCPP23FEATURES::test08_deducing_this_call_operator SKIPPED [ 14%]
test_cpp23features.py::TestCPP23FEATURES::test09_deducing_this_mixed_overload SKIPPED [ 14%]
test_cpp23features.py::TestCPP23FEATURES::test10_deducing_this_templated SKIPPED [ 15%]
test_cpp23features.py::TestCPP23FEATURES::test11_deducing_this_templated_with_args SKIPPED [ 15%]
test_cpp23features.py::TestCPP23FEATURES::test12_deducing_this_templated_returns_self_type SKIPPED [ 15%]
test_cpp23features.py::TestCPP23FEATURES::test13_deducing_this_abbreviated_auto SKIPPED [ 15%]
test_cpp23features.py::TestCPP23FEATURES::test14_deducing_this_by_value_copy_semantics SKIPPED [ 15%]
test_cpp23features.py::TestCPP23FEATURES::test15_deducing_this_inheritance SKIPPED [ 15%]
test_cpp23features.py::TestCPP23FEATURES::test16_blog_deduplication SKIPPED [ 16%]
test_cpp23features.py::TestCPP23FEATURES::test17_blog_crtp_postfix_increment SKIPPED [ 16%]
test_cpp23features.py::TestCPP23FEATURES::test18_blog_recursive_lambda SKIPPED [ 16%]
test_cpp23features.py::TestCPP23FEATURES::test19_blog_lambda_forwarding SKIPPED [ 16%]
test_cpp23features.py::TestCPP23FEATURES::test20_blog_pass_by_value SKIPPED [ 16%]
test_cpp23features.py::TestCPP23FEATURES::test21_blog_sfinae_friendly_transform SKIPPED [ 16%]
test_cpp23features.py::TestCPP23Driver::test_run_under_cpp23 PASSED [ 17%]
Many skips with one pass. The reader needs to know the implementation to figure out that all tests actually passed.
Right now, we do not have any means to configure the interpreter arguments programmatically. We might want to figure this out.
@vgvassilev, this might be a use case for sub-interpreters.
LGTM, otherwise. We can merge it.
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.
Exercise C++23 explicit object parameters (P0847R7, "deducing this") end-to-end through the interpreter (clang-repl and cling).
C++23 isn't the stack default and the interpreter is a process-wide singleton pinned at first
import cppyy, soTestCPP23Driverre-runs the class once in a child process that selects C++23 before import; all tests share that one interpreter. Bodies are ordinary Python; only thecppdefC++ source is a string.Covers the language mechanics (basic, const, by-value, extra-args, rvalue-ref, chaining, default arg, call operator, mixed overload, templated, abbreviated
this auto&&, inheritance) and the use-cases from the MSVC "Deducing this" blog post.🤖 Done with the help of Claude Code (Claude Opus 4.8)