This revision disallows lambdas in template parameters, as reported in PR33696.
Thanks, looks good other than ExpressionType. This is fine to commit with either of the names I suggested; let me know if you have a better alternative :)
This name is too vague as a member of Sema, but would be OK as a member of ExpressionEvaluationContextRecord, or if renamed to something like ExpressionEvaluationContextExprKind. (Also, we generally use Kind rather than Type for situations like this.)
Please also change the EnterExpressionEvaluationContext in TreeTransform::TransformTemplateArgument to specify EK_TemplateArgument (though that doesn't actually matter for the lambda diagnostics because we'll find all the problems in the template definition context). Then this LGTM. Thanks!
Should EK_TemplateParameter be EK_TemplateArgument?