From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 056673985831; Thu, 18 Jun 2020 11:26:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 056673985831 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592479576; bh=3m6wpM9tKUwb1MWHoOpK586m0OkN7rKKcMB/zYuhpdA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=g1TruIRycgw40LsTtTbZJCBnGD0npG3M+Iy+zc5H8Qvkw04H4gb3QY9E0wx4xcq9E q4a0PRyUFMF89m30BHxLq1rxszYC6IZMht2kuj03I/EFJ+O3usOB5DOyrTq/9hPUpe rhXgqMYKQli78sI0RKj2DECmSVvl0LF9oB/H2XwM= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95725] Confusing error diagnostic in an invalid template Date: Thu, 18 Jun 2020 11:26: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: 11.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org 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: 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: Thu, 18 Jun 2020 11:26:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95725 --- Comment #9 from Jonathan Wakely --- (In reply to Haoxin Tu from comment #6) > Hi, there. >=20 > I hold the view that the compiler should have good fault tolerance, which > means giving an input(even invalid), the compiler might emit appropriate > error message diagnostics so that we can fix them into valid code accordi= ng > to the diagnostics.=20 In an ideal world, yes. But this testcase is complete garbage. Nobody is go= ing to accidentally write that and be unable to see what's wrong with the code = when they get an error. We could spend time giving perfect diagnostics for unrealistic garbage, or = do more useful things. > I have tested in both GCC and Clang, the results show that GCC has lots of > unrelated diagnostic messages than Clang.=20 They're not unrelated, they're all directly related to the error in the cod= e. > In this report, GCC-trunk seems ok, but GCC-9 emits too many duplicated > error messages. So I guess there might something not correct in FE. So it's already fixed then. > Finally, I am wondering if those cases are useful for the GCC community? This particular case is not useful.=