On 11/13/2014 04:31 PM, Paolo Carlini wrote:
I think this should be replaced with fold_ if
(processing_template_decl) in build_enumerator.
Ok. The value can be NULL_TREE, thus in a straightforward change (per
the below) I have to check for that, otherwise we crash in
maybe_constant_value. Either that or just check for NULL_TREE at the
beginning of maybe_constant_value itself, I guess.
The current fold_ already checks for NULL_TREE; I think we want to
preserve that behavior.
This is the relatively most tricky change: we have a regression for
init/array11.C, because the gcc_assert at the end of
maybe_constant_value (called by maybe_constant_init) triggers:
gcc_assert (r == t
|| CONVERT_EXPR_P (t)
|| (TREE_CONSTANT (t) && !TREE_CONSTANT (r))
|| !cp_tree_equal (r, t));
we have VIEW_CONVERT_EXPRs, neither is constant, r != t and
cp_tree_equal is true. Wild guess: are VIEW_CONVERT_EXPRs also Ok?
Yes.
What did you think about avoiding the duplicate
instantiation_dependent_expression_p and potential_constant_expression
checks?
Jason