aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2009-01-22 07:15:41 +0000
committerDodji Seketeli <dodji@gcc.gnu.org>2009-01-22 08:15:41 +0100
commit03c2a308f32b01bdb5bea5538bccbb9b885b47a9 (patch)
tree8c0ca9e4a8b6ac8aced92cf10fba12e1269c35c1 /gcc/cp/decl2.c
parent73cc93abd2d93d6d5dcbfb8654bc7718a13c2476 (diff)
downloadgcc-03c2a308f32b01bdb5bea5538bccbb9b885b47a9.zip
gcc-03c2a308f32b01bdb5bea5538bccbb9b885b47a9.tar.gz
gcc-03c2a308f32b01bdb5bea5538bccbb9b885b47a9.tar.bz2
Reverted commit 143546 related to PR c++/26693
From-SVN: r143562
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c16
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