http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33911
Easwaran Raman <eraman at google dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |eraman at google dot com --- Comment #10 from Easwaran Raman <eraman at google dot com> --- For template member functions, is concatenating the parsed attributes to prefix_attributes and passing them to grokfield a valid fix? This patch works for a small test case I have and I wonder if this is correct: Index: gcc/cp/parser.c =================================================================== --- gcc/cp/parser.c (revision 202261) +++ gcc/cp/parser.c (working copy) @@ -16489,7 +16489,7 @@ cp_parser_init_declarator (cp_parser* parser, decl = grokfield (declarator, decl_specifiers, initializer, !is_non_constant_init, /*asmspec=*/NULL_TREE, - prefix_attributes); + chainon (prefix_attributes, attributes)); if (decl && TREE_CODE (decl) == FUNCTION_DECL) cp_parser_save_default_args (parser, decl); }