================
@@ -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:

Yeah, I am not sure why, but the `getTemplateInstantiationPattern` also returns 
null in this case. 

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