Commit 6ef72c36 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/83734 (ice in cxx_eval _statement_list, at cp/constexpr.c:3869)

	PR c++/83734
	* constexpr.c (cxx_eval_statement_list): Ignore DEBUG_BEGIN_STMTs
	in STATEMENT_LIST.  Remove unneeded assert.

	* g++.dg/cpp0x/pr83734.C: New test.

From-SVN: r256397
parent 0f146257
2018-01-09 Jakub Jelinek <jakub@redhat.com>
PR c++/83734
* constexpr.c (cxx_eval_statement_list): Ignore DEBUG_BEGIN_STMTs
in STATEMENT_LIST. Remove unneeded assert.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
......
......@@ -3851,6 +3851,8 @@ cxx_eval_statement_list (const constexpr_ctx *ctx, tree t,
for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
{
tree stmt = tsi_stmt (i);
if (TREE_CODE (stmt) == DEBUG_BEGIN_STMT)
continue;
r = cxx_eval_constant_expression (ctx, stmt, false,
non_constant_p, overflow_p,
jump_target);
......@@ -3859,14 +3861,6 @@ cxx_eval_statement_list (const constexpr_ctx *ctx, tree t,
if (returns (jump_target) || breaks (jump_target))
break;
}
/* Make sure we don't use the "result" of a debug-only marker. That
would be wrong. We should be using the result of the previous
statement, or NULL if there isn't one. In practice, this should
never happen: the statement after the marker should override the
result of the marker, so its value shouldn't survive in R. Now,
should that ever change, we'll need some fixing here to stop
markers from modifying the generated executable code. */
gcc_checking_assert (!r || TREE_CODE (r) != DEBUG_BEGIN_STMT);
return r;
}
......
2018-01-09 Jakub Jelinek <jakub@redhat.com>
PR c++/83734
* g++.dg/cpp0x/pr83734.C: New test.
2017-01-09 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/builtins-1.c (main): Add tests for vec_mergee and
......
// PR c++/83734
// { dg-do compile { target c++11 } }
// { dg-options "-g -O2" }
struct A { constexpr A () { typedef int T; } };
A a;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment