From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E8FC1387548A; Mon, 13 Jul 2020 12:28:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8FC1387548A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594643324; bh=2lc9pSbTl+NEB5h5G5fhBkysQi1G/598Tdiv66swhew=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OVEJ1Qzd+/SPEekHouF6Rh+MSQJfP9zlzKKi37Ta1tGSovqu7JcMik9xcTNOHKlTa 9827mb2Du/jST827zMlKpbREfH1/JTFe/WG4PNY4/WDQ3rYiraWVCuOIXGFdfnqWsb jbJUrlc+uDeBKmL8w0eIEgZH3g759UGPT+CjdK0c= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96182] GCC accepts constexpr function with no return-statement Date: Mon, 13 Jul 2020 12:28:44 +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: 11.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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_status everconfirmed keywords cf_reconfirmed_on bug_severity 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 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: Mon, 13 Jul 2020 12:28:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96182 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Keywords|accepts-invalid |diagnostic Last reconfirmed| |2020-07-13 Severity|normal |enhancement --- Comment #5 from Jonathan Wakely --- [decl.constexpr] p6 in the C++ standard says: "if no argument values exist such that an invocation of the function or constructor could be an evaluated subexpression of a core constant expressi= on [...] the program is ill-formed, no diagnostic required." So the foo() function is ill-formed, but implementations are not required to diagnose it unless the function is actually evaluated. So this is not accepts-invalid, but I'll confirm it as a request for a diagnostic enhancement.=