From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E509E3856DF4; Fri, 7 Oct 2022 08:12:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E509E3856DF4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665130345; bh=vHy/EL0b5UMw3xwEFbWJEonJ5fMUnHnJTrZVsMp7kIg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=furdFSTvbXEHpwGuY0g26IWizYf0PxGIOHtXJnZkUywuQ4+FMY4TteygXtCcQwSkQ YIIwYERufSeqlaccbJfhD5IjkUeEKF7tqBLXLY0JpxX2l1mCYetqLDGAL++FxRSpHC /qfPG2sUctaM8oMl1oxe2NY2cTMClwScJ2qt1cAs= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107178] Diagnosis for colon vs semi-colon in a member function declaration Date: Fri, 07 Oct 2022 08:12:23 +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.2.1 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: everconfirmed cf_reconfirmed_on bug_status 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=3D107178 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2022-10-07 Status|UNCONFIRMED |NEW --- Comment #3 from Jonathan Wakely --- (In reply to Andrew Pinski from comment #1) > GCC diagonstic seems reasonable. Only from the most mechanical perspective. > because GCC assumes you started to define a bitfield which is reasonable > assumention really. Not really, because the chances of somebody typing ':' instead of ';' is qu= ite high (they're on the same key on many keyboard layouts) and the chances of somebody trying to define a bit-field with a function type is practically z= ero. Although the parser just sees "bit-field with function type" we can apply s= ome intelligence and say that's probably not what the user was trying to do. A simple typo is more likely. > At least GCC points out the colon and even suggest you started a bitfield > which is what a colon normally does here .... But not with a function type.=