https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87481
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Fri Mar 22 14:40:59 2019 New Revision: 269874 URL: https://gcc.gnu.org/viewcvs?rev=269874&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/g++.dg/cpp1y/constexpr-87481.C Modified: trunk/gcc/ChangeLog trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c.opt trunk/gcc/cp/ChangeLog trunk/gcc/cp/constexpr.c trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog