Skip to content

Conversation

@guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Jan 21, 2026

The std::make_unique function is Pythonized to avoid unnecessary code generation by TClingCallFunc, which might also go wrong (as reported in GitHub issue #19122).

There is a fallback to calling the original make_unique for builtin types (introduced in [1]), but we don't need that if we know the builtin type can be readily used in the unique_ptr constructor, as is the case for int and float.

Hence, this commit suggests to not use the fallback for int and float, which also closes #19122 because no wrapper code has to be generated anymore.

[1] wlav/cppyy@62a97c9

@guitargeek guitargeek self-assigned this Jan 21, 2026
@guitargeek guitargeek changed the title [cppyy] Consider Python int and float in make_unique optimization [cppyy] Consider Python int as possible for make_unique optimization Jan 21, 2026
@guitargeek guitargeek changed the title [cppyy] Consider Python int as possible for make_unique optimization [cppyy] Consider Python int and float for make_unique optimization Jan 21, 2026
The `std::make_unique` function is Pythonized to avoid unnecessary code
generation by TClingCallFunc, which might also go wrong (as reported in
GitHub issue root-project#19122).

There is a fallback to calling the original `make_unique` for builtin
types (introduced in [1]), but we don't need that if we know the builtin
type can be readily used in the `unique_ptr` constructor, as is the case
for `int` and `float`.

Hence, this commit suggests to not use the fallback for `int` and
`float`, which also closes root-project#19122 because no wrapper code has to be
generated anymore.

[1] wlav/cppyy@62a97c9
@github-actions
Copy link

Test Results

    21 files      21 suites   3d 10h 17m 58s ⏱️
 3 757 tests  3 754 ✅ 0 💤  3 ❌
71 320 runs  71 299 ✅ 0 💤 21 ❌

For more details on these failures, see this check.

Results for commit 7a5a2b9.

@guitargeek guitargeek marked this pull request as draft January 22, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cppyy] C++11 tests fail on macOS26-Beta+XCode26 Beta1

1 participant