================ @@ -3128,6 +3128,26 @@ bool Type::isStdByteType() const { return false; } +static const TemplateDecl *getSpecializedTemplateType(const Type *T) { + const Type *DesugaredType = T->getUnqualifiedDesugaredType(); + if (const auto *Specialization = + DesugaredType->getAs<TemplateSpecializationType>()) + return Specialization->getTemplateName().getAsTemplateDecl(); + if (const auto *Record = DesugaredType->getAsCXXRecordDecl()) { + if (const auto *CTS = dyn_cast<ClassTemplateSpecializationDecl>(Record)) + return CTS->getSpecializedTemplate(); + } + return nullptr; +} + +bool Type::isTypeIdentitySpecialization() const { + const TemplateDecl *STDecl = getSpecializedTemplateType(this); + if (!STDecl) + return false; + IdentifierInfo *II = STDecl->getIdentifier(); + return II && STDecl->isInStdNamespace() && II->isStr("type_identity"); ---------------- cor3ntin wrote:
can II actually be null ? https://github.com/llvm/llvm-project/pull/113510 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits