This means an empty parameter list, no attributes, and no exception
specification. */
tree param_list = void_list_node;
- tree attributes = NULL_TREE;
+ tree std_attrs = NULL_TREE;
+ tree gnu_attrs = NULL_TREE;
tree exception_spec = NULL_TREE;
tree template_param_list = NULL_TREE;
tree tx_qual = NULL_TREE;
/* In the decl-specifier-seq of the lambda-declarator, each
decl-specifier shall either be mutable or constexpr. */
int declares_class_or_enum;
- if (cp_lexer_next_token_is_decl_specifier_keyword (parser->lexer))
+ if (cp_lexer_next_token_is_decl_specifier_keyword (parser->lexer)
+ && !cp_next_tokens_can_be_gnu_attribute_p (parser))
cp_parser_decl_specifier_seq (parser,
CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR,
&lambda_specs, &declares_class_or_enum);
/* Parse optional exception specification. */
exception_spec = cp_parser_exception_specification_opt (parser);
- attributes = cp_parser_std_attribute_spec_seq (parser);
+ std_attrs = cp_parser_std_attribute_spec_seq (parser);
/* Parse optional trailing return type. */
if (cp_lexer_next_token_is (parser->lexer, CPP_DEREF))
return_type = cp_parser_trailing_type_id (parser);
}
+ if (cp_next_tokens_can_be_gnu_attribute_p (parser))
+ gnu_attrs = cp_parser_gnu_attributes_opt (parser);
+
/* The function parameters must be in scope all the way until after the
trailing-return-type in case of decltype. */
pop_bindings_and_leave_scope ();
exception_spec,
return_type,
/*requires_clause*/NULL_TREE);
- declarator->std_attributes = attributes;
+ declarator->std_attributes = std_attrs;
fco = grokmethod (&return_type_specs,
declarator,
- NULL_TREE);
+ gnu_attrs);
if (fco != error_mark_node)
{
DECL_INITIALIZED_IN_CLASS_P (fco) = 1;