JuliaInterop / Clang.jl

C binding generator and Julia interface to libclang
https://juliainterop.github.io/Clang.jl/
MIT License
219 stars 68 forks source link

Try to fix `getNumArguments` for `TypeRef`-ed `FunctionTemplateDecl`s #419

Closed Gnimuc closed 1 year ago

Gnimuc commented 1 year ago

I don't know how to craft an MWE to test this PR, but this may be the solution.

cc @giordano

giordano commented 1 year ago

I have the feeling this might be a problem in libclang, because with Clang.jl v0.17 + julia v1.9 (llvm 14) Clang.LibClang.clang_Cursor_getNumArguments(method) gives me -1 on the method where I expect >1 arguments, as long as the method object is constructed correctly (which I have no idea whether that's true or not :slightly_smiling_face:).

Edit: but I guess Clang.LibClang.clang_Cursor_getNumArguments(method) is the same as before this PR, which is trying to work around that, right?

Gnimuc commented 1 year ago

it looks like FunctionTemplateDecl can not be dyn_cast to a typical FunctionDecl in the newer Clang. I'm closing this PR as it's not the correct way to fix the problem.