diff options
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 22192a0..c888725 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -804,9 +804,6 @@ grokfield (const cp_declarator *declarator, DECL_NONLOCAL (value) = 1; DECL_CONTEXT (value) = current_class_type; - if (declspecs->specs[(int)ds_typedef]) - set_underlying_type (value); - if (processing_template_decl) value = push_template_decl (value); @@ -1128,6 +1125,19 @@ save_template_attributes (tree *attr_p, tree *decl_p) if (!late_attrs) return; + /* Give this type a name so we know to look it up again at instantiation + time. */ + if (TREE_CODE (*decl_p) == TYPE_DECL + && DECL_ORIGINAL_TYPE (*decl_p) == NULL_TREE) + { + tree oldt = TREE_TYPE (*decl_p); + tree newt = build_variant_type_copy (oldt); + DECL_ORIGINAL_TYPE (*decl_p) = oldt; + TREE_TYPE (*decl_p) = newt; + TYPE_NAME (newt) = *decl_p; + TREE_USED (newt) = TREE_USED (*decl_p); + } + if (DECL_P (*decl_p)) q = &DECL_ATTRIBUTES (*decl_p); else |