struct norm_info : subst_info
{
- explicit norm_info (tsubst_flags_t cmp)
- : norm_info (NULL_TREE, cmp)
+ explicit norm_info (bool diag)
+ : norm_info (NULL_TREE, diag)
{}
/* Construct a top-level context for DECL. */
- norm_info (tree in_decl, tsubst_flags_t complain)
- : subst_info (tf_warning_or_error | complain, in_decl)
+ norm_info (tree in_decl, bool diag)
+ : subst_info (tf_warning_or_error, in_decl),
+ generate_diagnostics (diag)
{
if (in_decl)
{
initial_parms = DECL_TEMPLATE_PARMS (in_decl);
- if (generate_diagnostics ())
+ if (generate_diagnostics)
context = build_tree_list (NULL_TREE, in_decl);
}
else
initial_parms = current_template_parms;
}
- bool generate_diagnostics() const
- {
- return complain & tf_norm;
- }
-
void update_context(tree expr, tree args)
{
- if (generate_diagnostics ())
+ if (generate_diagnostics)
{
tree map = build_parameter_mapping (expr, args, ctx_parms ());
context = tree_cons (map, expr, context);
template parameters of ORIG_DECL. */
tree initial_parms = NULL_TREE;
+
+ /* Whether to build diagnostic information during normalization. */
+
+ bool generate_diagnostics;
};
static tree normalize_expression (tree, tree, norm_info);
tree t1 = normalize_expression (TREE_OPERAND (t, 1), args, info);
/* Build a new info object for the constraint. */
- tree ci = info.generate_diagnostics()
+ tree ci = info.generate_diagnostics
? build_tree_list (t, info.context)
: NULL_TREE;
if (!norm_cache)
norm_cache = hash_table<norm_hasher>::create_ggc (31);
norm_entry *entry = nullptr;
- if (!info.generate_diagnostics ())
+ if (!info.generate_diagnostics)
{
/* Cache the normal form of the substituted concept-id (when not
diagnosing). */
if (info.in_decl && concept_definition_p (info.in_decl))
ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P (atom) = true;
- if (!info.generate_diagnostics ())
+ if (!info.generate_diagnostics)
{
/* Cache the ATOMIC_CONSTRs that we return, so that sat_hasher::equal
later can cheaply compare two atoms using just pointer equality. */
/* Substitution errors during normalization are fatal. */
++processing_template_decl;
- norm_info info (in_decl, diag ? tf_norm : tf_none);
+ norm_info info (in_decl, diag);
tree t = get_normalized_constraints (CI_ASSOCIATED_CONSTRAINTS (ci), info);
--processing_template_decl;
gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
tree def = get_concept_definition (DECL_TEMPLATE_RESULT (tmpl));
++processing_template_decl;
- norm_info info (tmpl, diag ? tf_norm : tf_none);
+ norm_info info (tmpl, diag);
tree norm = get_normalized_constraints (def, info);
--processing_template_decl;
if (!expr || expr == error_mark_node)
return expr;
- if (!info.generate_diagnostics ())
+ if (!info.generate_diagnostics)
if (tree *p = hash_map_safe_get (normalized_map, expr))
return *p;
tree norm = get_normalized_constraints (expr, info);
--processing_template_decl;
- if (!info.generate_diagnostics ())
+ if (!info.generate_diagnostics)
hash_map_safe_put<hm_ggc> (normalized_map, expr, norm);
return norm;
? TMPL_PARMS_DEPTH (initial_parms) + 1 : 1),
make_tree_vec (0), initial_parms);
- norm_info info (diag ? tf_norm : tf_none);
+ norm_info info (diag);
info.initial_parms = initial_parms;
return normalize_constraint_expression (constr, info);
}
}
else if (TREE_CODE (t) == NESTED_REQ)
{
- norm_info ninfo (info.noisy () ? tf_norm : tf_none);
+ norm_info ninfo (info.noisy ());
/* The TREE_TYPE contains the set of template parameters that were in
scope for this nested requirement; use them as the initial template
parameters for normalization. */