+2006-10-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28506
+ * parser.c (function_declarator_p): New function.
+ (cp_parser_init_declarator): Use it.
+ (cp_parser_member_declaration): Likewise.
+
2006-10-12 Mark Mitchell <mark@codesourcery.com>
PR c++/29318
return parameter;
}
+/* Returns true iff DECLARATOR is a declaration for a function. */
+
+static bool
+function_declarator_p (const cp_declarator *declarator)
+{
+ while (declarator)
+ {
+ if (declarator->kind == cdk_function
+ && declarator->declarator->kind == cdk_id)
+ return true;
+ if (declarator->kind == cdk_id
+ || declarator->kind == cdk_error)
+ return false;
+ declarator = declarator->declarator;
+ }
+ return false;
+}
+
/* The parser. */
/* Overview
is_non_constant_init = true;
if (is_initialized)
{
- if (declarator->kind == cdk_function
- && declarator->declarator->kind == cdk_id
+ if (function_declarator_p (declarator)
&& initialization_kind == CPP_EQ)
initializer = cp_parser_pure_specifier (parser);
else
for a pure-specifier; otherwise, we look for a
constant-initializer. When we call `grokfield', it will
perform more stringent semantics checks. */
- if (declarator->kind == cdk_function
- && declarator->declarator->kind == cdk_id)
+ if (function_declarator_p (declarator))
initializer = cp_parser_pure_specifier (parser);
else
/* Parse the initializer. */