]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pt.c (instantiate_class_template): Set up the DECL_INITIAL of member constants.
authorJason Merrill <jason@yorick.cygnus.com>
Tue, 26 Jan 1999 20:23:36 +0000 (20:23 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 26 Jan 1999 20:23:36 +0000 (15:23 -0500)
* 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

gcc/cp/ChangeLog
gcc/cp/init.c
gcc/cp/pt.c

index edffd63980d09804126afc1f7a61dec0b12639ae..7342161b75b9dad81ecb2162ec1580c5394415fc 100644 (file)
@@ -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.
index 44911ebab7949d3a38fd2f77746060994f349e77..847222f3a0a8b8666cfbef2388478de779461ecb 100644 (file)
@@ -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);
     }
 
index 9bd73c240b81ee4f4bc760ef382609a7e50941f4..1db903dadc80a5d38cf2ae652b61719e25f98114 100644 (file)
@@ -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;