From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8F1DD3858021; Mon, 14 Mar 2022 14:38:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F1DD3858021 From: "eyalroz1 at gmx dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/42540] c++ error message [vtable undefined] is unhelpful Date: Mon, 14 Mar 2022 14:38:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 4.5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: eyalroz1 at gmx dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jyasskin at gmail dot com 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: Mon, 14 Mar 2022 14:38:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D42540 --- Comment #16 from Eyal Rozenberg --- Some comments following my recent dupe... (In reply to Andrew Pinski from comment #1) > I don't know if there is anything there could be done here since the link= er > is what is producing the error. The compiler could store information in the compiled object listing the vir= tual members for which no implementation was found, due to which reason the vtab= le was not defined already. In this specific example, storing the name of "A::= B()" somewhere. If that information is available, we could then petition linker authors to use it and print the missing virtual members in the error messag= e. (In reply to Richard Earnshaw from comment #5) > As suggested, there's no bug in the compiler here Not passing sufficient information to the linker is a "bug", or at least - a missing feature. (In reply to Zhihao Yuan from comment #11) > 2. Add extra information to name the key function, and pass it to the lin= ker, generate an error message to match MSVC's quality. I'm not quite sure what a key function is, but it sounds like my suggestion= is similar to this one. So, I support your suggestion (2.) > Calling this a "well-known issue" is irresponsible. The issue significan= tly > increases the bar to learners to consume and accept new paradigms in the > language. Not just learners. If you have a large class with many methods, whose implementation is spread across many files, it can take quite a bit of time= to figure out which method implementation is missing.=