pt.c (push_inline_template_parms_recursive): Don't recreate the CONST_DECL.
authorJason Merrill <jason@redhat.com>
Fri, 6 Nov 2015 15:33:24 +0000 (10:33 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 6 Nov 2015 15:33:24 +0000 (10:33 -0500)
* pt.c (push_inline_template_parms_recursive): Don't recreate the
CONST_DECL.

From-SVN: r229856

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

index 910005d985ad9c941f3648ecabf892eea275ad5b..fbbb6cb8d0d2309c40b6b9dcf04ca67d502c42a3 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-06  Jason Merrill  <jason@redhat.com>
+
+       * pt.c (push_inline_template_parms_recursive): Don't recreate the
+       CONST_DECL.
+
 2015-11-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * init.c (warn_placement_new_too_small): Use %wu format
index 45eda3a6d72a71ea41ed3a1409ffefd6ed608335..bfea8e20257d79c98260fa32aad3db0deebf6b14 100644 (file)
@@ -441,21 +441,8 @@ push_inline_template_parms_recursive (tree parmlist, int levels)
          break;
 
        case PARM_DECL:
-         {
-           /* Make a CONST_DECL as is done in process_template_parm.
-              It is ugly that we recreate this here; the original
-              version built in process_template_parm is no longer
-              available.  */
-           tree decl = build_decl (DECL_SOURCE_LOCATION (parm),
-                                   CONST_DECL, DECL_NAME (parm),
-                                   TREE_TYPE (parm));
-           DECL_ARTIFICIAL (decl) = 1;
-           TREE_CONSTANT (decl) = 1;
-           TREE_READONLY (decl) = 1;
-           DECL_INITIAL (decl) = DECL_INITIAL (parm);
-           SET_DECL_TEMPLATE_PARM_P (decl);
-           pushdecl (decl);
-         }
+         /* Push the CONST_DECL.  */
+         pushdecl (TEMPLATE_PARM_DECL (DECL_INITIAL (parm)));
          break;
 
        default: