Skip to content

[Python] Fix invalid overload selections via explicit constructors#19513

Merged
guitargeek merged 2 commits intoroot-project:masterfrom
guitargeek:issue-16573
Aug 4, 2025
Merged

[Python] Fix invalid overload selections via explicit constructors#19513
guitargeek merged 2 commits intoroot-project:masterfrom
guitargeek:issue-16573

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

In C++, it is forbidden to use explicit constructors in implicit
conversions, but cppyy was not aware of this so far.

This commit fixes that by disabling explicit constructors in the context
of implicit conversions.

Closes #16573.

In C++, it is forbidden to use `explicit` constructors in implicit
conversions, but cppyy was not aware of this so far.

This commit fixes that by disabling explicit constructors in the context
of implicit conversions.

Closes root-project#16573.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 3, 2025

Test Results

    21 files      21 suites   3d 5h 20m 43s ⏱️
 3 223 tests  3 223 ✅ 0 💤 0 ❌
65 909 runs  65 909 ✅ 0 💤 0 ❌

Results for commit 27f1e9b.

@guitargeek guitargeek merged commit 84a7d44 into root-project:master Aug 4, 2025
24 of 26 checks passed
@guitargeek guitargeek deleted the issue-16573 branch August 4, 2025 07:35
guitargeek added a commit to guitargeek/cppyy-backend that referenced this pull request Aug 6, 2025
This is important to avoid implicit conversions over explicit
constructors.

Taken from root-project/root#19513.
guitargeek added a commit to guitargeek/CPyCppyy that referenced this pull request Aug 6, 2025
In C++, it is forbidden to use `explicit` constructors in implicit
conversions, but cppyy was not aware of this so far.

This commit fixes that by disabling explicit constructors in the context
of implicit conversions.

Taken from root-project/root#19513
guitargeek added a commit to guitargeek/CPyCppyy that referenced this pull request Aug 11, 2025
In C++, it is forbidden to use `explicit` constructors in implicit
conversions, but cppyy was not aware of this so far.

This commit fixes that by disabling explicit constructors in the context
of implicit conversions.

Taken from root-project/root#19513
aaronj0 pushed a commit to aaronj0/CPyCppyy that referenced this pull request Jan 29, 2026
In C++, it is forbidden to use `explicit` constructors in implicit
conversions, but cppyy was not aware of this so far.

This commit fixes that by disabling explicit constructors in the context
of implicit conversions.

Taken from root-project/root#19513
aaronj0 pushed a commit to aaronj0/CPyCppyy that referenced this pull request Mar 2, 2026
In C++, it is forbidden to use `explicit` constructors in implicit
conversions, but cppyy was not aware of this so far.

This commit fixes that by disabling explicit constructors in the context
of implicit conversions.

Taken from root-project/root#19513
aaronj0 pushed a commit to aaronj0/CPyCppyy that referenced this pull request Mar 2, 2026
In C++, it is forbidden to use `explicit` constructors in implicit
conversions, but cppyy was not aware of this so far.

This commit fixes that by disabling explicit constructors in the context
of implicit conversions.

Taken from root-project/root#19513
aaronj0 pushed a commit to aaronj0/CPyCppyy that referenced this pull request Mar 3, 2026
In C++, it is forbidden to use `explicit` constructors in implicit
conversions, but cppyy was not aware of this so far.

This commit fixes that by disabling explicit constructors in the context
of implicit conversions.

Taken from root-project/root#19513
aaronj0 pushed a commit to compiler-research/CPyCppyy that referenced this pull request Mar 9, 2026
In C++, it is forbidden to use `explicit` constructors in implicit
conversions, but cppyy was not aware of this so far.

This commit fixes that by disabling explicit constructors in the context
of implicit conversions.

Taken from root-project/root#19513
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.

[Python] Overloads like foo(bool=true) not correctly resolved

3 participants