constexpr-89785-1.C
407 Bytes
-
re PR c++/89785 (Incorrect "not a constant expression" error with switch statement that returns) · c7a53bdb
PR c++/89785 * constexpr.c (struct check_for_return_continue_data): New type. (check_for_return_continue): New function. (potential_constant_expression_1) <case SWITCH_STMT>: Walk SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested in loop bodies and set *jump_target to that if found. * g++.dg/cpp1y/constexpr-89785-1.C: New test. * g++.dg/cpp1y/constexpr-89785-2.C: New test. From-SVN: r269995
Jakub Jelinek committed