The first patch is a cleanup hoisted from the c++-concepts branch: on the branch we want to be able to parse type/template in multiple places, so Andrew factored that out, but it's a good code cleanup on the trunk as well. While looking at this and related code on the branch, I noticed that there was a lot of redundant code in cp_parser_template_parameter for dealing with parameter packs that we should have handled already in cp_parser_parameter_declaration. I've dealt with that by taking over an unused flag in cp_parameter_declarator for passing back that the parameter is a pack. And while I was there I tweaked a permerror that wasn't using the permerror function. Tested x86_64-pc-linux-gnu, applying to trunk.