pt.c (coerce_template_parms): Make sure to digest_init if possible.
authorMark Mitchell <mmitchell@usa.net>
Thu, 18 Dec 1997 19:26:14 +0000 (19:26 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 18 Dec 1997 19:26:14 +0000 (14:26 -0500)
* pt.c (coerce_template_parms): Make sure to digest_init if
possible.

From-SVN: r17138

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

index 18e77ea58cbeb4da2bb200f5eed247a62a6a71bb..8899897a0f6287e10f0410c665c781b8db7720f1 100644 (file)
@@ -1,5 +1,8 @@
 Thu Dec 18 14:51:50 1997  Mark Mitchell  <mmitchell@usa.net>
 
+       * pt.c (coerce_template_parms): Make sure to digest_init if
+       possible.
+
        * decl.c (duplicate_decls): Make the newdecl virtual if the
        olddecl was, just as is done with other attributes of olddecl.
 
index c1cfa9253f5ca22c092c8216f35c8e07b93b8d56..9476d1286f83c49a5fb7f324dbf64e76f3c6c256 100644 (file)
@@ -1079,7 +1079,10 @@ coerce_template_parms (parms, arglist, in_decl)
          if (processing_template_decl)
            val = maybe_fold_nontype_arg (arg);
          else
-           val = digest_init (t, arg, (tree *) 0);
+           val = arg;
+
+         if (!uses_template_parms (val) && !uses_template_parms (t))
+           val = digest_init (t, val, (tree *) 0);
 
          if (val == error_mark_node 
              || (processing_template_decl && uses_template_parms (val)))