re PR c++/88449 (__builtin_is_constant_evaluated misbehaves due to constexpr call...
authorJakub Jelinek <jakub@redhat.com>
Wed, 12 Dec 2018 08:28:43 +0000 (09:28 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 12 Dec 2018 08:28:43 +0000 (09:28 +0100)
commitcce3ae91f21f185756f604f529501810d8025f37
tree2233210bda4863c89aa5f5033ebaf3d4d2dc63d1
parent2f00fb3d0ba1174dee21c33162a5fdc4e583a061
re PR c++/88449 (__builtin_is_constant_evaluated misbehaves due to constexpr call caching)

PR c++/88449
* constexpr.c (struct constexpr_call): Add pretend_const_required
member.
(constexpr_call_hasher::equal): Return false if pretend_const_required
members differ.
(cxx_eval_call_expression): Adjust new_call initialization.  Hash in
ctx->pretend_const_required.

* g++.dg/cpp2a/is-constant-evaluated1.C: Change from dg-do compile
to dg-do run.
(e): Adjust comment with correct expected value.
(main): Expect e == 1.
* g++.dg/cpp2a/is-constant-evaluated2.C: New test.

From-SVN: r267044
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated1.C
gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated2.C [new file with mode: 0644]