PR c++/86678 - constexpr function with non-constant after return.
commit32fee33442153252493605a28f125014ff7e048d
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 8 Sep 2018 16:00:02 +0000 (8 16:00 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 8 Sep 2018 16:00:02 +0000 (8 16:00 +0000)
tree86657620d81c1d04427d724399e476545acab7d9
parent9c1ea6eb80f12591d9a665a495723e342d787e3e
PR c++/86678 - constexpr function with non-constant after return.

In this testcase, the call to f() can never be a constant
expression, but that's not a problem because it isn't always
reached by calls to g.  We were wrongly rejecting this because
potential_constant_expression_1 lacked the jump tracking that
cxx_eval_constant_expression has.  So this patch adds a simpler
version of that tracking.

* constexpr.c (potential_constant_expression_1): Add jump_target.
(breaks): Check for BREAK_STMT.
(continues): Check for CONTINUE_STMT.

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