{
/* Set function_depth to avoid garbage collection. */
++function_depth;
- instantiate_decl (decl, false, false);
+ instantiate_decl (decl, /*defer_ok=*/false, false);
--function_depth;
}
complete_type (tmp);
for (fn = TYPE_METHODS (tmp); fn; fn = DECL_CHAIN (fn))
if (!DECL_ARTIFICIAL (fn))
- instantiate_decl (fn, /*defer_ok*/0, /*expl_inst_class*/false);
+ instantiate_decl (fn, /*defer_ok=*/false,
+ /*expl_inst_class=*/false);
}
break;
check_explicit_instantiation_namespace (result);
mark_decl_instantiated (result, extern_p);
if (! extern_p)
- instantiate_decl (result, /*defer_ok=*/1,
+ instantiate_decl (result, /*defer_ok=*/true,
/*expl_inst_class_mem_p=*/false);
}
{
mark_decl_instantiated (decl, extern_p);
if (! extern_p)
- instantiate_decl (decl, /*defer_ok=*/1,
+ instantiate_decl (decl, /*defer_ok=*/true,
/*expl_inst_class_mem_p=*/true);
}
}
/* Produce the definition of D, a _DECL generated from a template. If
- DEFER_OK is nonzero, then we don't have to actually do the
+ DEFER_OK is true, then we don't have to actually do the
instantiation now; we just have to do it sometime. Normally it is
an error if this is an explicit instantiation but D is undefined.
- EXPL_INST_CLASS_MEM_P is true iff D is a member of an
- explicitly instantiated class template. */
+ EXPL_INST_CLASS_MEM_P is true iff D is a member of an explicitly
+ instantiated class template. */
tree
-instantiate_decl (tree d, int defer_ok,
- bool expl_inst_class_mem_p)
+instantiate_decl (tree d, bool defer_ok, bool expl_inst_class_mem_p)
{
tree tmpl = DECL_TI_TEMPLATE (d);
tree gen_args;
int saved_inhibit_evaluation_warnings = c_inhibit_evaluation_warnings;
bool external_p;
bool deleted_p;
- tree fn_context;
- bool nested = false;
/* This function should only be used to instantiate templates for
functions and static member variables. */
if the variable has a constant value the referring expression can
take advantage of that fact. */
if (VAR_P (d))
- defer_ok = 0;
+ defer_ok = false;
/* Don't instantiate cloned functions. Instead, instantiate the
functions they cloned. */
goto out;
}
+ bool nested;
+ tree fn_context;
fn_context = decl_function_context (d);
nested = (current_function_decl != NULL_TREE);
vec<tree> omp_privatization_save;
else if (nested)
pop_function_context ();
-out:
- input_location = saved_loc;
- cp_unevaluated_operand = saved_unevaluated_operand;
- c_inhibit_evaluation_warnings = saved_inhibit_evaluation_warnings;
- pop_deferring_access_checks ();
- pop_tinst_level ();
if (nested)
restore_omp_privatization_clauses (omp_privatization_save);
+out:
+ pop_deferring_access_checks ();
timevar_pop (TV_TEMPLATE_INST);
+ pop_tinst_level ();
+ input_location = saved_loc;
+ cp_unevaluated_operand = saved_unevaluated_operand;
+ c_inhibit_evaluation_warnings = saved_inhibit_evaluation_warnings;
return d;
}
fn = TREE_CHAIN (fn))
if (! DECL_ARTIFICIAL (fn))
instantiate_decl (fn,
- /*defer_ok=*/0,
+ /*defer_ok=*/false,
/*expl_inst_class_mem_p=*/false);
if (COMPLETE_TYPE_P (instantiation))
reconsider = 1;
{
instantiation
= instantiate_decl (instantiation,
- /*defer_ok=*/0,
+ /*defer_ok=*/false,
/*expl_inst_class_mem_p=*/false);
if (DECL_TEMPLATE_INSTANTIATED (instantiation))
reconsider = 1;