https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33661
--- Comment #13 from Andreas Krebbel <krebbel at gcc dot gnu.org> --- Created attachment 35723 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35723&action=edit Experimental fix The attached patch fixes the problem for me. There appear to be two problems: 1. When parsing a template function cp_finish_decl returns before the asmspec is set in a var decl. 2. When expanding the template function the assembler_name is zeroed out.