diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-26 20:23:36 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-26 20:23:36 +0000 |
commit | cbd3ec046fabd09be22f45f87bcc0ab816a5ac8b (patch) | |
tree | 3bf365bde9b10142ba132ffbbfef283fe6c06958 /gcc | |
parent | 2ba28c7a4b448df2a396d0f6d5d5e8eb53a5f162 (diff) | |
download | ppe42-gcc-cbd3ec046fabd09be22f45f87bcc0ab816a5ac8b.tar.gz ppe42-gcc-cbd3ec046fabd09be22f45f87bcc0ab816a5ac8b.zip |
* 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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24875 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/init.c | 2 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 |
3 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index edffd63980d..7342161b75b 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 44911ebab79..847222f3a0a 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 9bd73c240b8..1db903dadc8 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; |