https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107310
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:0f6d443f0d0dd8a6bab99ab1957df3cd82541b27 commit r12-9432-g0f6d443f0d0dd8a6bab99ab1957df3cd82541b27 Author: Jason Merrill <ja...@redhat.com> Date: Tue Mar 14 12:20:51 2023 -0400 c++: -Wreturn-type with if (true) throw [PR107310] I removed this folding in GCC 12 because it was interfering with an experiment of richi's, but that never went in and the change causes regressions, so let's put it back. This reverts commit r12-5638-ga3e75c1491cd2d. PR c++/107310 gcc/cp/ChangeLog: * cp-gimplify.cc (genericize_if_stmt): Restore folding of constant conditions. gcc/testsuite/ChangeLog: * c-c++-common/Wimplicit-fallthrough-39.c: Adjust warning. * g++.dg/warn/Wreturn-6.C: New test.