Skip to content

Disallow conversion from C++ instance to function pointers#68

Open
guitargeek wants to merge 1 commit into
wlav:masterfrom
guitargeek:functor_to_function_ptr
Open

Disallow conversion from C++ instance to function pointers#68
guitargeek wants to merge 1 commit into
wlav:masterfrom
guitargeek:functor_to_function_ptr

Conversation

@guitargeek

@guitargeek guitargeek commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Implicit conversion from C++ instances to function pointers is not allowed in C++, and it can result in confusing overload resolutions if we allow it in cppyy.

See:

Corresponding ROOT commit:

Corresponding cppyy PR with the unit test:

Implicit conversion from C++ instances to function pointers is not
allowed in C++, and it can result in confusing overload resolutions if
we allow it in cppyy.

See:
  * root-project/root#20687 (comment)

Corresponding ROOT commit:
  * root-project/root@9976d3b#diff-5c6046149708192850b028f56795eafff3a409f2eba6e02790beb0c14423844f
aaronj0 added a commit to aaronj0/CPyCppyy that referenced this pull request Feb 10, 2026
From wlav#68 and root-project/root@9976d3b

Implicit conversion from C++ instances to function pointers is not
allowed in C++, and it can result in confusing overload resolutions if
we allow it in cppyy.

See root-project/root#20687 (comment)

Authored-by: Jonas Rembser <jonas.rembser@cern.ch>
aaronj0 added a commit to compiler-research/CPyCppyy that referenced this pull request Feb 11, 2026
From wlav#68 and root-project/root@9976d3b

Implicit conversion from C++ instances to function pointers is not
allowed in C++, and it can result in confusing overload resolutions if
we allow it in cppyy.

See root-project/root#20687 (comment)

Authored-by: Jonas Rembser <jonas.rembser@cern.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant