re PR c++/89652 (ICE during constexpr evaluation)
authorJakub Jelinek <jakub@redhat.com>
Thu, 14 Mar 2019 08:13:09 +0000 (09:13 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 14 Mar 2019 08:13:09 +0000 (09:13 +0100)
commit0ee285909bcef729415995e16c68e8713c59996f
tree9b58ba70a1a25f6b7a582ab1da5e135537361b8c
parent7da0bca130c98fa219b81f58da44f5e1222b321a
re PR c++/89652 (ICE during constexpr evaluation)

PR c++/89652
* constexpr.c (struct constexpr_ctx): Change save_exprs type from
hash_set<tree> to vec<tree>.
(cxx_eval_call_expression): Adjust for save_exprs being a vec instead
of hash_set.
(cxx_eval_loop_expr): Likewise.  Truncate the vector after each
removal of SAVE_EXPRs from values.
(cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
method on save_exprs instead of add.

* g++.dg/cpp1y/constexpr-89652.C: New test.

From-SVN: r269671
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/constexpr-89652.C [new file with mode: 0644]