On Fri, Apr 10, 2015 at 04:31:34AM +0100, Adam Butcher wrote:
> +/* Return true iff our current scope is a default capturing generic lambda
> +   defined within a template.  */
> +
> +bool
> +parsing_default_capturing_generic_lambda_in_template (void)
> +{
> +  if (processing_template_decl && current_class_type)
> +    if (tree lam = CLASSTYPE_LAMBDA_EXPR (current_class_type))
> +      if (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (lam) != CPLD_NONE)
> +     if (tree callop = lambda_function (lam))
> +       if (DECL_TEMPLATE_INFO (callop)
> +           && (DECL_TEMPLATE_RESULT (DECL_TI_TEMPLATE (callop))
> +               == callop)
> +           && ((current_nonlambda_class_type ()
> +                && CLASSTYPE_TEMPLATE_INFO (current_nonlambda_class_type ()))
> +               || ((current_nonlambda_function ()
> +                    && DECL_TEMPLATE_INFO (current_nonlambda_function ())))))
> +         return true;
> +  return false;
> +}
> +

Eek, why not &&s rather than cascading ifs?

> +++ b/gcc/testsuite/g++.dg/cpp1y/pr64382.C
> @@ -0,0 +1,23 @@
> +// PR c++/64382
> +// { dg-do compile { target c++1y } }

I think better use c++14 now.

        Marek

Reply via email to