[clang] [Clang] [Sema] Added a check for `NameInfo` actually containing a valid destructor name (PR #210610)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 19 23:04:45 PDT 2026


================
@@ -3286,6 +3287,10 @@ Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(
         TrailingRequiresClause);
     Method->setRangeEnd(Constructor->getEndLoc());
   } else if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(D)) {
+    if (NameInfo.getName().getNameKind() !=
+        DeclarationName::NameKind::CXXDestructorName)
+      return nullptr;
----------------
zyn0217 wrote:

Can you explain when a destructor would not have a DestructorName? Instead of bailing out here, can we ensure that invariance?

https://github.com/llvm/llvm-project/pull/210610


More information about the cfe-commits mailing list