[clang] Fix clang module lambda mangling (PR #235458)

Mihai Zegheru via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 26 02:41:27 PDT 2026


================
@@ -2004,7 +1949,12 @@ void CXXNameMangler::mangleLocalName(GlobalDecl GD,
     // Mangle the name relative to the closest enclosing function.
     // equality ok because RD derived from ND above
     if (D == RD) {
-      mangleUnqualifiedName(RD, DC, AdditionalAbiTags);
+      const NamedDecl *PrefixND = getClosurePrefix(RD);
+      if (PrefixND && !isCompatibleWith(LangOptions::ClangABI::Ver18))
----------------
mihaizegheru wrote:

Please corect me if I am wrong, but IIUC `mangleNestedNameWithClosurePrefix()` should always be guarded by that in order to avoid downstream breakages for older binary files.

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


More information about the cfe-commits mailing list