This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/88446] __builtin_is_constant_evaluated rejects some converted constant expressions.
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Dec 2018 08:44:59 +0000
- Subject: [Bug c++/88446] __builtin_is_constant_evaluated rejects some converted constant expressions.
- Auto-submitted: auto-generated
- References: <bug-88446-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88446
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Dec 12 08:44:27 2018
New Revision: 267047
URL: https://gcc.gnu.org/viewcvs?rev=267047&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/testsuite/ChangeLog