From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 746C73856DDD; Tue, 18 Apr 2023 20:45:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 746C73856DDD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681850741; bh=X7+qCGTyW2ui5/F85fUNYflYcHRDYiE0nej5sSJm+Ng=; h=From:To:Subject:Date:In-Reply-To:References:From; b=s1Ne+i7IB9OBWiqbjRYgZfJxRqqhpI7WY3Cn9q4GxIig/i4vRzE2jI/pur9MZr2iY kRhMnPDPIEEluCOkaDATBvrBMnLj9YNwFCKRfHlPDL31AbM9Wu/61cQuLZYmj+h+J5 /oIoBd6HZeKV2dUgzkL4fHBYjtnycvoLUUkIasYU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107310] [12 Regression] "warning: control reaches end of non-void function" with a throw under a trivially-true conditional since r12-5638-ga3e75c1491cd2d50 Date: Tue, 18 Apr 2023 20:45:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107310 --- Comment #7 from CVS Commits --- The releases/gcc-12 branch has been updated by Jason Merrill : https://gcc.gnu.org/g:0f6d443f0d0dd8a6bab99ab1957df3cd82541b27 commit r12-9432-g0f6d443f0d0dd8a6bab99ab1957df3cd82541b27 Author: Jason Merrill 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.=