]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: mangling of lambdas in default args [PR91241]
authorJason Merrill <jason@redhat.com>
Tue, 6 Apr 2021 02:50:44 +0000 (22:50 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 13 May 2022 15:20:38 +0000 (11:20 -0400)
commita86e0cadefe5a2469bb9872bb5b93017ccb23935
tree37f99c4ab7c5b4429fca06e203f7dcdcc17a9cad
parentaa030fca4b7257656aa6bfe879d79a332b3c39ea
c++: mangling of lambdas in default args [PR91241]

In this testcase, the parms remembered in LAMBDA_EXPR_EXTRA_SCOPE are no
longer the parms of the FUNCTION_DECL they have as their DECL_CONTEXT, so we
were mangling both lambdas as parm #0.  But since the parms are numbered
from right to left we don't need to need to find them in the FUNCTION_DECL,
we can measure their own DECL_CHAIN.

gcc/cp/ChangeLog:

PR c++/91241
* mangle.c (write_compact_number): Add sanity check.
(write_local_name): Use list_length for parm number.

gcc/testsuite/ChangeLog:

PR c++/91241
* g++.dg/abi/lambda-defarg1.C: New test.
gcc/cp/mangle.c
gcc/testsuite/g++.dg/abi/lambda-defarg1.C [new file with mode: 0644]