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

via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 20 21:32:29 PST 2026


================
@@ -1856,6 +1856,18 @@ static GlobalDecl getParentOfLocalEntity(const DeclContext *DC) {
   return GD;
 }
 
+// Build a parent GlobalDecl for unqualified-name mangling, preserving
+// constructor/destructor complete-object structor kinds.
+static GlobalDecl getParentGlobalDecl(const NamedDecl *ND) {
+  if (const auto *CD = dyn_cast<CXXConstructorDecl>(ND))
+    return GlobalDecl(CD, Ctor_Complete);
----------------
eiytoq wrote:

The current patch no longer hardcodes ctor/dtor kinds via a global helper. It preserves StructorType when `ND == Structor` in `manglePrefix` and avoids passing ctor/dtor through `GlobalDecl(NamedDecl)`.

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


More information about the cfe-commits mailing list