From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B795385700D; Fri, 10 Jul 2020 15:11:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B795385700D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594393911; bh=NuoXeaCry7ouf/fTvT84j0WgMcm7l0+VmGby5HZHHzU=; h=From:To:Subject:Date:From; b=i09VZ0dMjJx0b2hG2iZh4NMBD5ouVw0iRT/QPfGjtaA4wsa+wKfhI6YocQndH0D93 z5TMI2oOTZODLxKSGvwxFTh4O2fAFVDh3quPiSQ0cCyeAsYqDEbPiUfHguCNdrHnaf p+gXdjN3swNJFCdHh51Z06GEu9R2CHavXIGTn2W4= From: "r-gcc at mail dot uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96155] New: "throw" that is not executed in constexpr function fails to compile Date: Fri, 10 Jul 2020 15:11:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: r-gcc at mail dot uk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 15:11:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96155 Bug ID: 96155 Summary: "throw" that is not executed in constexpr function fails to compile Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: r-gcc at mail dot uk Target Milestone: --- This fails to compile on gcc trunk, while the same code compiles fine in cl= ang: constexpr bool foo() { for(int i =3D 0; i !=3D 5; ++i) { if(i =3D=3D 3) return false; } throw 5; return true; } this is the message I am getting: error: expression =E2=80=98=E2=80=99 is not a constant ex= pression live example: https://godbolt.org/z/eqqr4f=