================
@@ -4189,8 +4189,13 @@ llvm::DICompositeType 
*CGDebugInfo::CreateLimitedType(const RecordType *Ty) {
         llvm::MDNode::replaceWithDistinct(llvm::TempDICompositeType(RealDecl));
     break;
   }
-
-  RegionMap[Ty->getDecl()].reset(RealDecl);
+  if (auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(Ty->getDecl())) {
+    CXXRecordDecl *TemplateDecl =
+        CTSD->getSpecializedTemplate()->getTemplatedDecl();
+    RegionMap[TemplateDecl].reset(RealDecl);
+  } else {
+    RegionMap[Ty->getDecl()].reset(RealDecl);
+  }
----------------
ykhatav wrote:

Are you suggesting introducing a way to find the class template specialization 
the Typedef Decl belongs to, perhaps through the two functions you mentioned 
earlier? Since the PR is already approved, could you clarify if this is a 
suggestion for a follow-up task, or if you'd like it incorporated into this PR 
before merging? If it's a follow-up, should a new issue be created for it?

https://github.com/llvm/llvm-project/pull/146729
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to