TemplateName::getAsTemplateDecl() returns the underlying TemplateDecl
for a UsingTemplate kind template name. We should respect that in the
Profile method otherwise we might desugar the template name unexpectedly
(e.g. for template argument deduction with deduciton guides).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
FWIW, I believe this patch does the right thing by marking the DeducedTemplateSpecializationType as using. It's explicitly introduced into the global namespace through the using decl, and even before 3e78fa860235431323aaf08c8fa922d75a7cfffa we weren't marking them as such.
But I am still not sure about the implications of this in the modules world. So adding @ChuanqiXu as a reviewer in case he has more insights.
Yeah, this one should be correct. Modules techniques use *::Profile method to judge if two entities are the same extensively. So it would be best to add a test case for modules like we did in https://reviews.llvm.org/rG3e78fa860235431323aaf08c8fa922d75a7cfffa. And it doesn't matter if you are not interested, I'll take it later then.
Thanks for the review.
I'm landing the patch as-is now. It would be nice for you to add a related test for modules afterwards (since I don't have much knowledge about clang module stuff).