tree ret = (spec->handler) (cur_and_last_decl, name, args,
flags|cxx11_flag, &no_add_attrs);
+ /* Fix up typedefs clobbered by attribute handlers. */
+ if (TREE_CODE (*node) == TYPE_DECL
+ && anode == &TREE_TYPE (*node)
+ && DECL_ORIGINAL_TYPE (*node)
+ && TYPE_NAME (*anode) == *node
+ && TYPE_NAME (cur_and_last_decl[0]) != *node)
+ {
+ tree t = cur_and_last_decl[0];
+ DECL_ORIGINAL_TYPE (*node) = t;
+ tree tt = build_variant_type_copy (t);
+ cur_and_last_decl[0] = tt;
+ TREE_TYPE (*node) = tt;
+ TYPE_NAME (tt) = *node;
+ }
+
*anode = cur_and_last_decl[0];
if (ret == error_mark_node)
{
TYPE_QUALS (type));
if (TYPE_USER_ALIGN (type))
*node = build_aligned_type (*node, TYPE_ALIGN (type));
-
- tree decl = node[2];
- if (decl && TYPE_NAME (type) == decl)
- {
- /* Set up the typedef all over again. */
- DECL_ORIGINAL_TYPE (decl) = NULL_TREE;
- TREE_TYPE (decl) = *node;
- set_underlying_type (decl);
- *node = TREE_TYPE (decl);
- }
}
return NULL_TREE;