From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 787133858D33; Sun, 27 Aug 2023 16:16:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 787133858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693153015; bh=m2+Aro2PkFU6Xpd26HqwDCZjC60mwzS++AzF/xIU6d0=; h=From:To:Subject:Date:From; b=inKFKYdhQQ+Aepuuzy/MlpeT03Nrhc87f7YhhJ98TwNpHeuSiqvPqd9yt83Gtf9lJ DvLLwxu/vFlTbebKTyhGIuxlYtQb/v1Y3D2H2iXWqVtsSOVDPiW6nt3cSUvdVhNPKr 0wXfCen6C70WOs8Qze8jqWhK8fkgsGnw40XfODyY= From: "janschultke at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111173] New: G++ allows constinit functions Date: Sun, 27 Aug 2023 16:16:55 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: janschultke at googlemail dot com 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111173 Bug ID: 111173 Summary: G++ allows constinit functions Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: janschultke at googlemail dot com Target Milestone: --- ## Code to Reproduce using Function =3D int(); constinit Function f; ## Expected Output (provided by clang trunk) :2:1: error: constinit can only be used in variable declarations 2 | constinit Function f; | ^ 1 error generated. ## Actual Output (https://godbolt.org/z/7rdEhhj1s) This code compiles with any version of GCC that supports C++20 from what I could tell. constinit looks to have no effect.=