re PR c++/88446 (__builtin_is_constant_evaluated rejects some converted constant...
authorJakub Jelinek <jakub@redhat.com>
Wed, 12 Dec 2018 08:44:27 +0000 (09:44 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 12 Dec 2018 08:44:27 +0000 (09:44 +0100)
commit13de99bc7d085125e614ffdb75d486e9a7a8a48f
treeb608cbd81f75cde8ce4f3264c08646a15e1fb0ba
parent66e30545db6ed4c1913e76d1085d0586ee6d055d
re PR c++/88446 (__builtin_is_constant_evaluated rejects some converted constant expressions.)

PR c++/88446
* cp-tree.h (maybe_constant_value): Add manifestly_const_eval
argument.
* constexpr.c (struct constexpr_call): Rename pretend_const_required
member to manifestly_const_eval.
(struct constexpr_ctx): Likewise.
(constexpr_call_hasher::equal): Adjust users.
(cxx_eval_builtin_function_call): Likewise.  Formatting fix.
(cxx_eval_call_expression): Adjust users.
(cxx_eval_outermost_constant_expr, maybe_constant_init_1,
maybe_constant_init): Rename pretend_const_required argument to
manifestly_const_eval, adjust function comments.
(maybe_constant_value): Add manifestly_const_eval argument.  If true,
don't cache and call cxx_eval_outermost_constant_expr with true as
manifestly_const_eval.
* decl.c (compute_array_index_type_loc): Call maybe_constant_value
with true as manifestly_const_eval.

* g++.dg/cpp2a/is-constant-evaluated3.C: New test.

From-SVN: r267047
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated3.C [new file with mode: 0644]