In order to obtain the methods of an instantiated template class, Claw emits to a temporary file, /tmp/.../prepared_implicit.h, a global variable declaration, using the instantiation as the variable's type. This causes Clang errors if the template class has no default constructor.
I tried changing the variable declaration to an explicit instantiation (e.g., template class foo<arg>;). This almost worked; it got rid of the error, but the default copy and move constructors disappeared from the result. (An explicit copy constructor does get emitted.) I think this probably counts as a Libclang bug, but trying to fix Libclang is a rabbit hole I don't want to go down right now.
I don't think we care about the move constructor, but the copy constructor could be important. OTOH, it would be nice to get rid of these errors. OTOOH, they don't seem to keep Claw from running to completion.
I don't think anything needs to be done about this right now, but I wanted to record what I had learned about it, and maybe get your opinion.
In order to obtain the methods of an instantiated template class, Claw emits to a temporary file,
/tmp/.../prepared_implicit.h, a global variable declaration, using the instantiation as the variable's type. This causes Clang errors if the template class has no default constructor.I tried changing the variable declaration to an explicit instantiation (e.g.,
template class foo<arg>;). This almost worked; it got rid of the error, but the default copy and move constructors disappeared from the result. (An explicit copy constructor does get emitted.) I think this probably counts as a Libclang bug, but trying to fix Libclang is a rabbit hole I don't want to go down right now.I don't think we care about the move constructor, but the copy constructor could be important. OTOH, it would be nice to get rid of these errors. OTOOH, they don't seem to keep Claw from running to completion.
I don't think anything needs to be done about this right now, but I wanted to record what I had learned about it, and maybe get your opinion.