Fix c++/67371 (issues with throw in constexpr)
commit748c426a1b106499ced440f548743efdde564d4d
authortrippels <trippels@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Aug 2015 18:51:26 +0000 (29 18:51 +0000)
committertrippels <trippels@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Aug 2015 18:51:26 +0000 (29 18:51 +0000)
tree813dae7e59ddb927d2ea8535efd5aa49086dc622
parent08bd9c7ad6acfcef822747dfbb6b56e3b92f34a1
Fix c++/67371 (issues with throw in constexpr)

As PR67371 shows gcc currently rejects all throw statements in
constant-expressions, even when they are never executed.

PR c++/67371
* constexpr.c (potential_constant_expression_1): Remove IF_STMT
case. Move label to COND_EXPR case. Remove checking of
SWITCH_STMT_BODY.

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