diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-02-17 15:18:08 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-02-17 15:18:08 -0500 |
commit | 3a0bc47cdb670c8f1e0996e6255ee1084eb7febf (patch) | |
tree | 15b1a9aff4c04eaf0854d44d5f48b4327608a8aa /include | |
parent | 6245441e124846d0c3551f312d2feef598fe251c (diff) | |
download | gcc-3a0bc47cdb670c8f1e0996e6255ee1084eb7febf.zip gcc-3a0bc47cdb670c8f1e0996e6255ee1084eb7febf.tar.gz gcc-3a0bc47cdb670c8f1e0996e6255ee1084eb7febf.tar.bz2 |
c++: make manifestly_const_eval tri-state
This patch converts the constexpr machinery's manifestly_const_eval flag
into a tri-state enum to allow us to express wanting to fold
__builtin_is_constant_evaluated to false via speculative constexpr
evaluation. For now, only the maybe_constant_value entry point is
changed to take this enum; the others continue to take bool. The
subsequent patch will teach cp_fold (which uses maybe_constant_value) to
fold the builtin to false when called from cp_fold_function and
cp_fully_fold_init.
gcc/cp/ChangeLog:
* constexpr.cc (constexpr_call::manifestly_const_eval): Give
it type int instead of bool.
(constexpr_ctx::manifestly_const_eval): Give it type mce_value
instead of bool.
(cxx_eval_builtin_function_call): Adjust after making
manifestly_const_eval tri-state.
(cxx_eval_call_expression): Likewise.
(cxx_eval_binary_expression): Likewise.
(cxx_eval_conditional_expression): Likewise.
(cxx_eval_constant_expression): Likewise.
(cxx_eval_outermost_constant_expr): Likewise.
(cxx_constant_value): Likewise.
(cxx_constant_dtor): Likewise.
(maybe_constant_value): Give manifestly_const_eval parameter
type mce_value instead of bool and adjust accordingly.
(fold_non_dependent_expr_template): Adjust call
to cxx_eval_outermost_constant_expr.
(fold_non_dependent_expr): Likewise.
(maybe_constant_init_1): Likewise.
* constraint.cc (satisfy_atom): Adjust call to
maybe_constant_value.
* cp-tree.h (enum class mce_value): Define.
(maybe_constant_value): Adjust manifestly_const_eval parameter
type and default argument.
* decl.cc (compute_array_index_type_loc): Adjust call to
maybe_constant_value.
* pt.cc (convert_nontype_argument): Likewise.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions