On Tue, Jan 19, 2021 at 10:54:08PM +0100, Jakub Jelinek via Gcc-patches wrote: > So like this then if it passes bootstrap/regtest?
Successfully bootstrapped/regtested on x86_64-linux and i686-linux. > > 2021-01-19 Jakub Jelinek <ja...@redhat.com> > > PR c++/98672 > * constexpr.c (check_for_return_continue_data): Add break_stmt member. > (check_for_return_continue): Also look for BREAK_STMT. Handle > SWITCH_STMT > by ignoring break_stmt from its body. > (potential_constant_expression_1) <case FOR_STMT>, > <case WHILE_STMT>: If the condition isn't constant true, check if > the loop body can contain a return stmt. > <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer. > <case IF_STMT>: If recursion with tf_none is successful, merge > *jump_target from the branches - returns with highest priority, breaks > or continues lower. If then branch is potentially constant and > doesn't return, check the else branch if it could return, break or > continue. > > * g++.dg/cpp1y/constexpr-98672.C: New test. Jakub