Biohazrd icon indicating copy to clipboard operation
Biohazrd copied to clipboard

Some methods on template specializations are translated without parameters

Open PathogenDavid opened this issue 3 years ago • 2 comments

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 avatar Mar 30 '21 15:03 PathogenDavid

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

PathogenDavid avatar Mar 30 '21 16:03 PathogenDavid

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.

PathogenDavid avatar Jul 04 '21 13:07 PathogenDavid