[clang] [Clang] Fix Itanium mangling crash for local lambda in ctor/dtor (PR #181068)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 5 12:59:16 PDT 2026


================
@@ -1755,6 +1735,51 @@ void CXXNameMangler::mangleUnqualifiedName(
   }
 }
 
+void CXXNameMangler::mangleConstructorName(
+    const NamedDecl *ND, const AbiTagList *AdditionalAbiTags) {
+  const CXXRecordDecl *InheritedFrom = nullptr;
+  TemplateName InheritedTemplateName;
+  const TemplateArgumentList *InheritedTemplateArgs = nullptr;
+  if (auto Inherited =
+          cast<CXXConstructorDecl>(ND)->getInheritedConstructor()) {
----------------
efriedma-quic wrote:

If we're going to assume the ND is actually a CXXConstructorDecl, please make mangleConstructorName take a CXXConstructorDecl as an argument, and make the caller perform the cast.

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


More information about the cfe-commits mailing list