On 2014-02-24 18:16, Jason Merrill wrote:
On 02/24/2014 02:32 AM, Adam Butcher wrote:
+static bool function_being_declared_is_template_p (cp_parser* parser)

Function name should be at the beginning of the next line.

Doh!  Fixed.

-      if (scope->kind != sk_template_parms)
+      if (scope->kind != sk_template_parms
+         || !function_being_declared_is_template_p (parser))

Is there a reason not to move the scope->kind check into the new function?

It is used within 'cp_parser_parameter_declaration_list' (PATCH 1/2) without a need for a scope. The 'scope' here is the result of winding back from the scope of the generic type parameter to beyond the function and class scopes. I could have just used

  if (!function_being_declared_is_template_p (parser))

here but it can be avoided if we ended up at a non-'sk_template_parms' scope as we know already that there is no template parm list.

Adam

Reply via email to