c++: generic lambda in template fn with DMI [PR100054]
get_nsdmi instantiates default member initializers on demand. It tries to
push into the context of the class before doing so, so access checking works
properly, but since my patch for 90479 not for local classes. We should
only be doing this when any template parameters have arguments. But in this
case, we get here while regenerating a generic lambda, so
processing_template_decl is true, even though the class and its DMI are
non-dependent at this point. And so we crashed. So let's do more of the
pushing into the context of the class even for local classes.
gcc/cp/ChangeLog:
PR c++/100054
PR c++/90479
* init.c (get_nsdmi): Do more context adjustment for local classes.
gcc/testsuite/ChangeLog:
PR c++/100054
* g++.dg/cpp1y/lambda-generic-local-class1.C: New test.