MochiLibraries / Biohazrd

A framework for automatically generating binding wrappers for C/C++ libraries
MIT License
60 stars 8 forks source link

Some methods on template specializations are translated without parameters #182

Open PathogenDavid opened 3 years ago

PathogenDavid commented 3 years ago

This is likely very similar to how methods were missing for template specializations. Not sure why it seemingly only happens to overloaded assignment operators though.

The fix for methods in general was to enumerate directly from Clang instead of libclang:

https://github.com/InfectedLibraries/Biohazrd/blob/79a17535cc94cb1b56b44452191a00974a8be37d/Biohazrd/%23Declarations/TranslatedRecord.cs#L109-L110

Which means we probably need to do something similar here:

https://github.com/InfectedLibraries/Biohazrd/blob/79a17535cc94cb1b56b44452191a00974a8be37d/Biohazrd/%23Declarations/TranslatedFunction.cs#L45-L46

Although I'd prefer using FunctionDecl::parameters for this purpose. (Unlike CXXRecordDecl::methods, this isn't just a simple filtered iterator of the DeclContext children.)

PathogenDavid commented 3 years ago

Some constructors seem to be affected too. (In particular, VecWriterProxy in OpenCV.)

PathogenDavid commented 3 years ago

I believe the new ABI changes are going to start asserting around here since the cursor parameter list and the arranged argument list sizes are not going to match. We could synthesize parameters based on the arranged function as a workaround if the above proves to be annoying.