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

Soham Karandikar via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 22 22:06:06 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;
----------------
skadewdl3 wrote:

@zyn0217 I've moved the check to after template instantiation to signify the intent better.

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


More information about the cfe-commits mailing list