Skip to content

Commit 2119c25

Browse files
committed
c++: Update mangling of lambdas in expressions
itanium-cxx-abi/cxx-abi#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 <[email protected]>
1 parent 685c458 commit 2119c25

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

gcc/cp/mangle.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3799,7 +3799,7 @@ write_expression (tree expr)
37993799
equivalent.
38003800
38013801
So just use the closure type mangling. */
3802-
write_string ("tl");
3802+
write_char ('L');
38033803
write_type (LAMBDA_EXPR_CLOSURE (expr));
38043804
write_char ('E');
38053805
}

gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ struct C {
66
void f(decltype([](T, auto) { return 0; })) {}
77
};
88
void g() { C().f<int>({}); }
9-
// { dg-final { scan-assembler "_ZN1C1fIiEEvDTtlNS_UlT_TL0__E_EEE" } }
9+
// { dg-final { scan-assembler "_ZN1C1fIiEEvDTLNS_UlT_TL0__E_EEE" } }

gcc/testsuite/g++.dg/cpp2a/lambda-generic-mangle1a.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ struct C {
77
void f(decltype([](T, auto) { return 0; })) {}
88
};
99
void g() { C().f<int>({}); }
10-
// { dg-final { scan-assembler "_ZN1C1fIiEEvDTtlNS_UlT_T_E_EEE" } }
10+
// { dg-final { scan-assembler "_ZN1C1fIiEEvDTLNS_UlT_T_E_EEE" } }

0 commit comments

Comments
 (0)