http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58816
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I had a look with a cross cc1plus and I think the below is enough to resolve
the issue. Can you fully test it? x86_64-linux is still fine with it. By the
way, we have got a couple of similar issues: PR58724 (I sent a patch to
gcc-patches a few days ago) and PR58600 (I added something to the audit trail):
Index: pt.c
===================================================================
--- pt.c (revision 203886)
+++ pt.c (working copy)
@@ -8610,7 +8610,7 @@ apply_late_template_attributes (tree *decl_p, tree
pass it through tsubst. Attributes like mode, format,
cleanup and several target specific attributes expect it
unmodified. */
- else if (attribute_takes_identifier_p (TREE_PURPOSE (t)))
+ else if (attribute_takes_identifier_p (get_attribute_name (t)))
{
tree chain
= tsubst_expr (TREE_CHAIN (TREE_VALUE (t)), args, complain,