]> gcc.gnu.org Git - gcc.git/commit
c++: lambda in concept [PR105652]
authorJason Merrill <jason@redhat.com>
Fri, 27 May 2022 02:43:05 +0000 (22:43 -0400)
committerJason Merrill <jason@redhat.com>
Sat, 28 May 2022 03:43:54 +0000 (23:43 -0400)
commit221acd67ca50f8f069037e034a3250f13d75a9f5
tree3ea19b804a58d1514f5dd303d2cb234fd750ec3a
parentd9176e643f385c3ef3b8c28cbc0468776fd8a14f
c++: lambda in concept [PR105652]

We currently check satisfaction in the context of the constrained
declaration (which may be wrong, see PR104111).  When checking C<int>
for S<int>, we currently substitute into the lambda in the context of
S<T> (rather than S<int>, which seems wrong if the above isn't wrong), so
the new closure type thinks its context is S<T>, which confuses debug
output.  For the moment, let's work around all of this by overriding the
context of the closure.

PR c++/105652

gcc/cp/ChangeLog:

* pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
instantiate into a class-scope lambda.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-lambda20.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp2a/concepts-lambda20.C [new file with mode: 0644]
This page took 0.065218 seconds and 5 git commands to generate.