2014-02-21 Jason Merrill <jason@redhat.com>
+ PR c++/60252
+ * lambda.c (maybe_resolve_dummy): Don't try to capture this
+ in declaration context.
+
DR 1591
PR c++/60051
* pt.c (unify): Only unify if deducible. Handle 0-length list.
if (type != current_class_type
&& current_class_type
&& LAMBDA_TYPE_P (current_class_type)
- && DERIVED_FROM_P (type, current_nonlambda_class_type ()))
+ && DERIVED_FROM_P (type, current_nonlambda_class_type ())
+ /* If we get here while parsing the parameter list of a lambda, it
+ will fail, so don't even try (c++/60252). */
+ && current_binding_level->kind != sk_function_parms)
{
/* In a lambda, need to go through 'this' capture. */
tree lam = CLASSTYPE_LAMBDA_EXPR (current_class_type);