[clang] [RFC] Initial implementation of P2719 (PR #113510)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 29 23:28:08 PDT 2025
================
@@ -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;
+}
+
----------------
ojhunt wrote:
As we've removed this logic entirely now I've reverted the addition of the method
https://github.com/llvm/llvm-project/pull/113510
More information about the cfe-commits
mailing list