c++: static lambda tsubst [PR108526]
commit4f181f9c7ee3efc509d185fdfda33be9018f1611
authorJason Merrill <jason@redhat.com>
Tue, 7 Mar 2023 02:36:28 +0000 (6 21:36 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 7 Mar 2023 19:34:10 +0000 (7 14:34 -0500)
tree2cf9f6fe3d9b7ca4c707d21d93597c8b930a97b9
parentf875857e008c4415c32d2f15e88f04c3e42719ea
c++: static lambda tsubst [PR108526]

A missed piece of the patch for static operator(): in tsubst_function_decl,
we don't want to replace the first parameter with a new closure pointer if
operator() is static.

PR c++/108526
PR c++/106651

gcc/cp/ChangeLog:

* pt.cc (tsubst_function_decl): Don't replace the closure
parameter if DECL_STATIC_FUNCTION_P.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/static-operator-call5.C: Pass -g.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp23/static-operator-call5.C