[cfe-dev] Clang API: specialise a class template and all its members

Dimitar Dobrev via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 11 15:53:49 PST 2016


Hello all,

I have a clang::ClassTemplateDecl object with a single template argument. I want to specialise it for a certain type (void*). I use the following code:

clang::TemplateArgument t(C->getASTContext().VoidPtrTy);
auto CTSVoidStar = clang::ClassTemplateSpecializationDecl::Create(C->getASTContext(),
clang::TagTypeKind::TTK_Class, CTS->getDeclContext(), clang::SourceLocation(), clang::SourceLocation(),
CTS->getSpecializedTemplate(), &t, CTS->getTemplateArgs().size(), CTS);

where CTS->getSpecializedTemplate() is my ClassTemplateDecl. The problem with it is while according to CTSVoidStar->dump() it looks correct, it lacks any functions, and it's the functions that I need - their mangled names in particular. I know for sure that my ClassTemplateDecl does have functions. My question is how to get a complete specialisation, with all members and not just the class itself. Thank you.


Regards,
Dimitar Dobrev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160311/ea2b5f00/attachment.html>


More information about the cfe-dev mailing list