[Bug c++/67371] Never executed "throw" in constexpr function fails to compile
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Aug 29 18:52:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67371
--- Comment #8 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Author: trippels
Date: Sat Aug 29 18:51:26 2015
New Revision: 227323
URL: https://gcc.gnu.org/viewcvs?rev=227323&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
trunk/gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c
More information about the Gcc-bugs
mailing list