From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0D5F23858C78; Thu, 8 Feb 2024 20:29:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D5F23858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707424197; bh=o310YTriYlKK40u5zpwFN5sp8vNzKN1Wwa5Rpzx7XQo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bz6FExr8DRIF+RsrBQOe+jo21yFyyDz1TaZb/1Ej5BJ3TqHLvA2xKMN5GbbiQ7W4d aASGMHef+rQRHkqmERoHmHdhWN64MimWo71arVIMyzCzPdURPP5ys9a9jQXvNvwBb1 /BuwqBCEnvkRWknSbeTLGPtEMUSHxOhBB1fgwmzw= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113839] misleading syntax error message Date: Thu, 08 Feb 2024 20:29:55 +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: 13.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal 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: 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=3D113839 --- Comment #5 from Jonathan Wakely --- (In reply to Frank Heckenbach from comment #0) > While I appreciate gcc trying to by helpful, it seems it goes wrong rather > often. That doesn't match my experience. The errors that mention a specific grammar production tend to be accurate, with the odd exception like this bug (which will get fixed). I find the problem is that telling the user that a particular grammar production (like "unqualified-id" or "primary-expression") is expected isn't really helpful to the layperson who doesn't memorize the BNF-like grammar in the standard. Clang tends to do a better job in that regard, balancing accu= racy with comprehensibility. If you encounter cases where a diagnostic is misleading, wrong, or just unhelpfully technical in its wording, please do report them so they can be improved.=