Here, we are calling template_class_depth on a FIELD_DECL corresponding
to a lambda that is used inside variable template. template_class_depth
however does not see that this FIELD_DECL is used inside a variable
template binding because its chain of DECL_CONTEXTs does not include the
corresponding VAR_DECL. So template_class_depth returns the wrong
template nesting level which causes its callers to malfunction. In
particular we strip a template argument level in
tsubst_copy [FIELD_DECL] when we shouldn't have.
This patch makes template_class_depth look at a lambda type's
LAMBDA_TYPE_EXTRA_SCOPE field instead of its TYPE_CONTEXT, so that it
can iterate into an enclosing variable template, if applicable.
Tested on x86_64-pc-linux gnu, no new regressions. Also tested against
Boost. Is this OK to commit?