wlav / cppyy

Other
400 stars 41 forks source link

Failing to correctly infer return type as function pointer #65

Closed cstyl closed 2 years ago

cstyl commented 2 years ago

Hi, I've been trying to port with cppyy an example that would return a function pointer as follows:

import cppyy

cppyy.cppdef("""
typedef void (*func_t)(void);

func_t foo(){
    return func_t();
}
""")

cppyy.gbl.foo()

However, it fails to infer the return type with the following error:

input_line_19:11:15: error: expected expression
      ((FP5 (&)())foo)();

Thanks, Chris

wlav commented 2 years ago

Yes, was ignored. Now in repo.

wlav commented 2 years ago

Released with 2.4.0 and its dependencies.