c++: enum in generic lambda in template [PR95317]
authorJason Merrill <jason@redhat.com>
Mon, 5 Apr 2021 18:26:03 +0000 (14:26 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 5 Apr 2021 19:38:40 +0000 (15:38 -0400)
commit9f4c41147a41d08a74990eafe69a1064a3c13435
tree08e89d70528811b8da24ef88296eb7eaf06a50ae
parent62d60246e53778db6ee613377dd013ba4b264968
c++: enum in generic lambda in template [PR95317]

Here we weren't instantiating the enumerators because the arglist still had
the template parameter for the generic lambda, so looking one up failed.  We
need to instantiate if the non-lambda enclosing scope is non-dependent.

gcc/cp/ChangeLog:

PR c++/95317
* pt.c (lookup_template_class_1): Do tsubst_enum when
tsubsting a generic lambda.

gcc/testsuite/ChangeLog:

PR c++/95317
* g++.dg/cpp1y/lambda-generic-enum1.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp1y/lambda-generic-enum1.C [new file with mode: 0644]