From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01C233858C35; Thu, 8 Feb 2024 19:17:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01C233858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707419867; bh=GobZKOLGPqoQIWf/pVUd63jUbqizNPSzgKawSOBV2+0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=J0o5UuYIUh/dp5VMe+OTx0tYSppnSs7rS6Cb6+6a0AjHUWFZ+KD0Gs1X5IkHDhL3u BmursWXkYHN/cChO8gtxIH6Fs4QbQG899LwpVzRCuClaMp7N5vqljXt1o7/Fa8UEdf 8/W4QNv5xlwnlglnqBKp/MPe1V4zQut0mhcgm3fM= From: "f.heckenbach@fh-soft.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113839] misleading syntax error message Date: Thu, 08 Feb 2024 19:17:46 +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: f.heckenbach@fh-soft.de 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 #3 from Frank Heckenbach --- > Except C++ parsing does not allow for that because C++ parsing requires > unlimited look ahead. While that's true in general, I think in specific cases (including most real-world cases), the look-ahead required is limited. E.g., here, I think = it's clear the program is ill-formed at the ";" at the latest, perhaps even at t= he "{}" already. Even if gcc can't determine the cause of the error, I'd prefer if it said so rather than chosing one (IMHO unlikely) candidate for correction. (Is there actually a primary-expression that could be inserted there to make the prog= ram correct, or would this only lead to the next error?)=