Skip to content

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

Merged
aaronj0 merged 1 commit into
compiler-research:masterfrom
aaronj0:functor_to_function_ptr
Feb 11, 2026
Merged

Disallow conversion from C++ instance to function pointers#168
aaronj0 merged 1 commit into
compiler-research:masterfrom
aaronj0:functor_to_function_ptr

Conversation

@aaronj0

@aaronj0 aaronj0 commented Feb 11, 2026

Copy link
Copy Markdown
Collaborator

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)

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

aaronj0 commented Feb 11, 2026

Copy link
Copy Markdown
Collaborator Author

Test at compiler-research/cppyy#183

@vgvassilev vgvassilev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aaronj0 aaronj0 merged commit 664a6a8 into compiler-research:master Feb 11, 2026
38 checks passed
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.

2 participants