diff mbox series

[v2,2/3] c++: Update mangling of lambdas in expressions

Message ID 672f1c18.170a0220.e2dd2.5300@mx.google.com
State New
Headers show
Series [v2,1/3] c++: Fix mangling of otherwise unattached class-scope lambdas [PR107741] | expand

Commit Message

Nathaniel Shead Nov. 9, 2024, 8:23 a.m. UTC
Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk?

-- >8 --

https://github.com/itanium-cxx-abi/cxx-abi/pull/85 clarifies that
mangling a lambda expression should use 'L' rather than "tl".

gcc/cp/ChangeLog:

	* mangle.cc (write_expression): Update mangling for lambdas.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/lambda-generic-mangle1.C: Update mangling.
	* g++.dg/cpp2a/lambda-generic-mangle1a.C: Likewise.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
---
 gcc/cp/mangle.cc                                     | 2 +-
 gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1.C  | 2 +-
 gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1a.C | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc
index 4d46c0917a9..42fcdc34353 100644
--- a/gcc/cp/mangle.cc
+++ b/gcc/cp/mangle.cc
@@ -3761,7 +3761,7 @@  write_expression (tree expr)
 	 equivalent.
 
 	 So just use the closure type mangling.  */
-      write_string ("tl");
+      write_char ('L');
       write_type (LAMBDA_EXPR_CLOSURE (expr));
       write_char ('E');
     }
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1.C b/gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1.C
index 0051307f53d..306959a4f9f 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1.C
@@ -6,4 +6,4 @@  struct C {
   void f(decltype([](T, auto) { return 0; })) {}
 };
 void g() { C().f<int>({}); }
-// { dg-final { scan-assembler "_ZN1C1fIiEEvDTtlNS_UlT_TL0__E_EEE" } }
+// { dg-final { scan-assembler "_ZN1C1fIiEEvDTLNS_UlT_TL0__E_EEE" } }
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1a.C b/gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1a.C
index dc7b0125631..b7bd4ecdd46 100644
--- a/gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1a.C
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1a.C
@@ -7,4 +7,4 @@  struct C {
   void f(decltype([](T, auto) { return 0; })) {}
 };
 void g() { C().f<int>({}); }
-// { dg-final { scan-assembler "_ZN1C1fIiEEvDTtlNS_UlT_T_E_EEE" } }
+// { dg-final { scan-assembler "_ZN1C1fIiEEvDTLNS_UlT_T_E_EEE" } }