[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 5 09:50:36 PDT 2024
================
@@ -139,28 +165,63 @@ TemplateName::NameKind TemplateName::getKind() const {
return AssumedTemplate;
if (uncommon->getAsSubstTemplateTemplateParm())
return SubstTemplateTemplateParm;
+ if (uncommon->getAsDeducedTemplateName())
+ return DeducedTemplate;
+
+ assert(uncommon->getAsSubstTemplateTemplateParmPack() != nullptr);
return SubstTemplateTemplateParmPack;
}
-TemplateDecl *TemplateName::getAsTemplateDecl() const {
- if (Decl *TemplateOrUsing = Storage.dyn_cast<Decl *>()) {
- if (UsingShadowDecl *USD = dyn_cast<UsingShadowDecl>(TemplateOrUsing))
- return cast<TemplateDecl>(USD->getTargetDecl());
-
- assert(isa<TemplateDecl>(TemplateOrUsing));
- return cast<TemplateDecl>(TemplateOrUsing);
- }
+TemplateDecl *TemplateName::getAsTemplateDecl(bool IgnoreDeduced) const {
----------------
cor3ntin wrote:
That change looks sort of unrelated?
https://github.com/llvm/llvm-project/pull/94981
More information about the cfe-commits
mailing list