Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyROOT: wrong overload resolution for C++ functions from python #11924

Closed
1 task
VanyaBelyaev opened this issue Dec 18, 2022 · 3 comments
Closed
1 task

PyROOT: wrong overload resolution for C++ functions from python #11924

VanyaBelyaev opened this issue Dec 18, 2022 · 3 comments

Comments

@VanyaBelyaev
Copy link

  • Checked for duplicates

Describe the bug

For ROOT 6.27 (LCG dev23 nightly slot) I see a wrong overload resolution for pair of functions that takes argumentof type double and std::complex<double>. The complex veruison of function is invoked, whle double version is ignored:

see here

Expected behavior

I would expect the proper overleoad resolution: the double function is inviked for double argument
and std::complex<double> version is invoked for the complex argument

To Reproduce

see the gist here

Setup

  1. ROOT Version 6.27
  2. LCG dev3 nightly cvmfs slot, x86_64-centos7-gcc12-opt platform

Additional context

@VanyaBelyaev
Copy link
Author

The output is here:

Function(x):  myfun(1.0)=(1+0j)
Function(x):  myfun((1+1j))=(1+1j)

The first line demonstrates the problem:
here I expect to obtain double value instead of complex.
For both argument type, std::complex<double> version of the function is invoked

@vepadulano
Copy link
Member

Hi @VanyaBelyaev ,
Thanks for reaching out! I can't take a look at this right now, but I know the place where overload resolution happens and it is not the first time that I see this unexpected behaviour from cppyy. I assign this to myself, will let you know when I have news.

@guitargeek
Copy link
Contributor

This will indeed be fixed when updating to the newest CPyCppyy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants