I discovered a cleanup I'd forgotten about. The only unobvious thing
about this patch is that just before the second hunk we've already set
DECL_RTL to NULL. No need to do it twice.
nathan
--
Nathan Sidwell
2017-06-19 Nathan Sidwell <nat...@acm.org>
* pt.c (coerce_template_parms): Fix indentation.
(tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
in to single block.
Index: pt.c
===================================================================
--- pt.c (revision 249364)
+++ pt.c (working copy)
@@ -8101,10 +8101,10 @@ coerce_template_parms (tree parms,
parm = TREE_VEC_ELT (parms, parm_idx);
if (parm == error_mark_node)
- {
- TREE_VEC_ELT (new_inner_args, arg_idx) = error_mark_node;
- continue;
- }
+ {
+ TREE_VEC_ELT (new_inner_args, arg_idx) = error_mark_node;
+ continue;
+ }
/* Calculate the next argument. */
if (arg_idx < nargs)
@@ -12947,13 +12947,11 @@ tsubst_decl (tree t, tree args, tsubst_f
/* The initializer must not be expanded until it is required;
see [temp.inst]. */
DECL_INITIAL (r) = NULL_TREE;
- if (VAR_P (r))
- SET_DECL_MODE (r, VOIDmode);
- if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL))
- SET_DECL_RTL (r, NULL);
DECL_SIZE (r) = DECL_SIZE_UNIT (r) = 0;
if (VAR_P (r))
{
+ SET_DECL_MODE (r, VOIDmode);
+
/* Possibly limit visibility based on template args. */
DECL_VISIBILITY (r) = VISIBILITY_DEFAULT;
if (DECL_VISIBILITY_SPECIFIED (t))