Skip to content
Snippets Groups Projects
Commit 6173f713 authored by Jason Merrill's avatar Jason Merrill
Browse files

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.
parent 474cb5a0
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment