wlav / cppyy

Other
387 stars 39 forks source link

An error occurred when calling the addressof function #168

Closed shrealist closed 8 months ago

shrealist commented 1 year ago

minimal reproducible code:

cppyy.addressof(cppyy.gbl.std.vector[int].at.__overload__(':any:', True))

output:

input_line_30:2:2: error: reference to overloaded function could not be resolved; did you mean to call it? &std::vector<int, std::allocator >::at ^~~~~~~~~~~

wlav commented 1 year ago

That error comes from the fallback if the address can not be resolved. In this case probably b/c either (or both) b/c it's a template that hasn't been instantiated yet or b/c it's an inlined function. The fallback clearly was too simplistic, missing the overload argument types. (The idea of it is that by forcing the interpreter to create the symbol in a transaction, it can subsequently be found in the JIT symbols.)

Fixed in repo.

wlav commented 8 months ago

Released with release 3.1.0. Feel free to reopen if you continue to have issues.