TYPENAME_TYPEs and SCOPE_REFs that were previously dependent. */
tree args = current_template_args ();
tree auto_node = type_uses_auto (type);
+ tree pushed;
if (auto_node)
{
tree auto_vec = make_tree_vec (1);
TREE_VEC_ELT (auto_vec, 0) = auto_node;
args = add_to_template_args (args, auto_vec);
}
- push_scope (scope);
+ pushed = push_scope (scope);
type = tsubst (type, args, tf_warning_or_error, NULL_TREE);
- pop_scope (scope);
+ if (pushed)
+ pop_scope (scope);
}
if (type == error_mark_node)
specialize R. */
gen_tmpl = most_general_template (DECL_TI_TEMPLATE (t));
argvec = tsubst_template_args (DECL_TI_ARGS
- (DECL_TEMPLATE_RESULT (gen_tmpl)),
+ (DECL_TEMPLATE_RESULT
+ (DECL_TI_TEMPLATE (t))),
args, complain, in_decl);
/* Check to see if we already have this specialization. */