aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-01-26 20:23:36 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-01-26 15:23:36 -0500
commit94c82a77fde8fa2c197f61f8acc1ade19a13acdb (patch)
tree3bf365bde9b10142ba132ffbbfef283fe6c06958 /gcc
parent1b528097cdf347b2149b2c81dd2c3327642e61f1 (diff)
downloadgcc-94c82a77fde8fa2c197f61f8acc1ade19a13acdb.zip
gcc-94c82a77fde8fa2c197f61f8acc1ade19a13acdb.tar.gz
gcc-94c82a77fde8fa2c197f61f8acc1ade19a13acdb.tar.bz2
pt.c (instantiate_class_template): Set up the DECL_INITIAL of member constants.
* pt.c (instantiate_class_template): Set up the DECL_INITIAL of member constants. g++.ns/template6.C * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in a ctor initializer. g++.other/typedef6.C From-SVN: r24875
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/init.c2
-rw-r--r--gcc/cp/pt.c4
3 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index edffd63..7342161 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
1999-01-26 Jason Merrill <jason@yorick.cygnus.com>
+ * pt.c (instantiate_class_template): Set up the DECL_INITIAL of
+ member constants.
+
+ * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in
+ a ctor initializer.
+
* tree.c (equal_functions): Fix name in prototype.
* decl.c (push_local_binding): Add FLAGS argument.
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 44911eb..847222f 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -898,7 +898,7 @@ expand_member_init (exp, name, init)
if (name && TREE_CODE (name) == TYPE_DECL)
{
- basetype = TREE_TYPE (name);
+ basetype = TYPE_MAIN_VARIANT (TREE_TYPE (name));
name = DECL_NAME (name);
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 9bd73c2..1db903d 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4748,6 +4748,10 @@ instantiate_class_template (type)
{
pending_statics = perm_tree_cons (NULL_TREE, r, pending_statics);
/* Perhaps we should do more of grokfield here. */
+ if (DECL_DEFINED_IN_CLASS_P (r))
+ /* Set up DECL_INITIAL, since tsubst doesn't. */
+ DECL_INITIAL (r) = tsubst_expr (DECL_INITIAL (t), args,
+ NULL_TREE);
start_decl_1 (r);
DECL_IN_AGGR_P (r) = 1;
DECL_EXTERNAL (r) = 1;