[cfe-dev] ASTContext::getCanonicalTemplateTemplateParmDecl

Balázs Kéri via cfe-dev cfe-dev at lists.llvm.org
Mon Mar 18 06:05:16 PDT 2019


Hello!

I want to figure out how the
ASTContext::getCanonicalTemplateTemplateParmDecl function should work. For
a class template partial specialization object and TemplateTemplateParmDecl
in a TemplateArgument, the function is called from
getCanonicalTemplateArgument. It creates a new not initialized
TemplateTemplateParmDecl object that is used in the new TemplateName and
TemplateArgument. The TemplateName now contains an uninitialized
TemplateTemplateParmDecl that is not linked to the old (and correct)
TemplateTemplateParmDecl. At least when the function is called from
ASTReader::ReadTemplateArgument.

Can somebody tell if this is a bug or how the code (ReadTemplateArgument if
Canonicalize==true) should work? This code was introduced in commit 47ba20a
("[modules] When loading a template specialization, re-canonicalize its…")
years ago.

Regards,
Balázs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190318/80d5973b/attachment.html>


More information about the cfe-dev mailing list