From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8447F395B818; Wed, 16 Nov 2022 16:35:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8447F395B818 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668616541; bh=T+qGGlCvlRFMF7tSB/JG/xKt1sG3W9C+j83Onzjl1GA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fqI+csc0QrrupujNzGxP7YcdpoGSlBmizWnSrpGPdcfkjQq/drLEVKA041zCFw0Ie Yvk36npIYTrWJoKqzuepsoZu3ShD1p/jO207UWqGuWzirNaxPqXU9Knc+cxZyQ9iPE qDeYJ7V6UWOWccoJaXpP3dKI43Za9iR6rnHPQ5UA= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107310] [12/13 Regression] "warning: control reaches end of non-void function" with a throw under a trivially-true conditional since r12-5638-ga3e75c1491cd2d50 Date: Wed, 16 Nov 2022 16:35:39 +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: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek --- This is similar to C: void bar (int *x); __attribute__((noreturn)) void baz (void); int foo (void) { int a __attribute__((cleanup (bar))); if (1) baz (); } on which we were at -O0 warning already in 4.7, haven't tried older compile= rs. In C we optimizing the if (0) and if (1) conditions at genericization time, only in C++ we were and now we no longer do.=