PR c++/89241 - ICE with lambda in template parameter list.
We were getting confused by a lambda in template definition context that
isn't actually in the scope of any templated entity. Fixed by telling
type_dependent_expression_p that such a lambda is type-dependent even if we
can't tell that from its closure type. I've also restored the error for
defining a non-lambda class in a default template argument, and for a lambda
befor C++20.
* parser.c (cp_parser_lambda_expression): Also reject a lambda in a
template parameter list before C++20.
* pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
* semantics.c (begin_class_definition): Restore error about defining
non-lambda class in template parm list.
From-SVN: r269972