c++: static lambda in template [PR108526]
authorJason Merrill <jason@redhat.com>
Tue, 24 Jan 2023 20:29:35 +0000 (15:29 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 24 Jan 2023 22:11:52 +0000 (17:11 -0500)
commit39ade88fa1632c659c5c4ed065fa2b62d16a8670
treee0c78eb5f4e883d2c314a33cca76fbf1ebe3939d
parent1c407dc088231ba5f2cc63d9278f4b797db48de1
c++: static lambda in template [PR108526]

tsubst_lambda_expr uses build_memfn_type to build a METHOD_TYPE for the new
lamba op().  This is not what we want for a C++23 static op(), but since we
also use that METHOD_TYPE to communicate the closure type down to
tsubst_function_decl, let's wait and turn it back at that point.

PR c++/108526

gcc/cp/ChangeLog:

* pt.cc (tsubst_function_decl): Handle static lambda.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/static-operator-call5.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp23/static-operator-call5.C [new file with mode: 0644]