]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: unifying LAMBDA_EXPR [PR122318]
authorPatrick Palka <ppalka@redhat.com>
Tue, 17 Feb 2026 16:21:42 +0000 (11:21 -0500)
committerPatrick Palka <ppalka@redhat.com>
Tue, 17 Feb 2026 16:21:42 +0000 (11:21 -0500)
commit9fe46ba8eb3f2cf41744cf8490b025f0876b9c86
treeeeb9dd15d1a5578ae97e87a5276c40600aeb11dc
parent5932fb71d5ccbcd6119e4e9eae315d4a8795726f
c++: unifying LAMBDA_EXPR [PR122318]

This patch makes the default case of unify accept LAMBDA_EXPR P/A pairs,
which we can legitimately hit during alias CTAD guide overload resolution.
We can also less legimitately hit this during partial specialization
matching (likely IFNDR).

I'm not totally sure if we want to handle them like any other non-deducible
expression vs handling them separately (returning success iff they're ==).
I couldn't come up with a testcase for which it mattered so I went the
simpler route.

PR c++/122318
PR c++/101670

gcc/cp/ChangeLog:

* pt.cc (unify) <default>: Accept LAMBDA_EXPR.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/lambda-targ20.C: New test.
* g++.dg/cpp2a/lambda-targ21.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp2a/lambda-targ20.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/lambda-targ21.C [new file with mode: 0644]