]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/87481
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Mar 2019 14:40:59 +0000 (14:40 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Mar 2019 14:40:59 +0000 (14:40 +0000)
commit84f13b2f3dbd0bb258b43843caa7d06c81a286a2
tree8606dad0f353d85630d41e4b1e4b709dce94fd2e
parent26b210817c3240f7b2014ab97938b6b1b4cdf8ee
PR c++/87481
* doc/invoke.texi (-fconstexpr-ops-limit=): Document.

* c.opt (-fconstexpr-ops-limit=): New option.

* constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
(cxx_eval_constant_expression): When not skipping, not constant class
or location wrapper, increment *ctx->constexpr_ops_count and if it is
above constexpr_loop_nest_limit, diagnose failure.
(cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
initialize ctx.constexpr_ops_count to its address.
(is_sub_constant_expr): Likewise.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269874 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/constexpr-87481.C [new file with mode: 0644]