================ @@ -1938,6 +1938,17 @@ TagDecl *Type::getAsTagDecl() const { return nullptr; } +const TemplateSpecializationType * +Type::getAsNonAliasTemplateSpecializationType() const { + for (const auto *T = this; /**/; /**/) { + const TemplateSpecializationType *TST = + T->getAs<TemplateSpecializationType>(); + if (!TST || !TST->isTypeAlias()) + return TST; + T = TST->desugar().getTypePtr(); + } +} ---------------- erichkeane wrote:
Ah, right, so: ``` const auto *TST = this->getAs<TemplateSpecializationType>(); while (TST && TST->isTypeAlias()) { TST = TST->desugar()->getAs<TemplateSpecializationType>(); } return TST; ``` Right? I think that does what you were intending. Effectively a 'while is-type-specialization-type and is-type-alias'. https://github.com/llvm/llvm-project/pull/135916 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits