Fix c++/67371 (issues with throw in constexpr)
authorMarkus Trippelsdorf <markus@trippelsdorf.de>
Sat, 29 Aug 2015 18:51:26 +0000 (18:51 +0000)
committerMarkus Trippelsdorf <trippels@gcc.gnu.org>
Sat, 29 Aug 2015 18:51:26 +0000 (18:51 +0000)
commitce9657302380f236754ad11d6b8d0f0109075e37
tree813dae7e59ddb927d2ea8535efd5aa49086dc622
parent04ffad35321aaebeff3ffa8764d26454d93db59e
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.

From-SVN: r227323
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]