From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7931F3959C23; Tue, 10 Aug 2021 11:41:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7931F3959C23 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101811] Error not helpful for misplaced 'template' Date: Tue, 10 Aug 2021 11:41:15 +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.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 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: Tue, 10 Aug 2021 11:41:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101811 --- Comment #5 from Jonathan Wakely --- (In reply to Tobias Schl=C3=BCter from comment #4) > we are at a stage where grammatical niceties matter, I would make the sym= bol > in the first message the subject, so >=20 > :6:6: error: 'template void X::f()' matches no declaration > 6 | void X::f() > | ^ No, I disagree. The function declarator can be arbitrarily long, sometimes wrapping over several lines on the screen. If the important "matches no declaration" text is at an arbitrary place on the screen it is hard to find= . If it appears immediately after the "error:" string (which is typically highlighted in red) then you don't have to scan the output to find it. "X matches no declaration" also seems grammatically worse than "no declarat= ion matches X", but that's debatable.=