Skip to content

Template class with no default constructor causes Clang errors #21

Description

@slburson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions