public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "eyalroz1 at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-42540-4-53V0AsBMi8@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-42540-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42540

--- Comment #16 from Eyal Rozenberg <eyalroz1 at gmx dot com> ---
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 linker
> is what is producing the error.

The compiler could store information in the compiled object listing the virtual
members for which no implementation was found, due to which reason the vtable
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 message.

(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 linker, 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 significantly
> 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.

  parent reply	other threads:[~2022-03-14 14:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-42540-4@http.gcc.gnu.org/bugzilla/>
2011-03-17 15:41 ` manu at gcc dot gnu.org
2011-03-17 16:17 ` jyasskin at gcc dot gnu.org
2020-07-22 13:56 ` redi at gcc dot gnu.org
2020-07-22 13:57 ` redi at gcc dot gnu.org
2020-07-22 13:57 ` redi at gcc dot gnu.org
2022-03-14 14:20 ` redi at gcc dot gnu.org
2022-03-14 14:38 ` eyalroz1 at gmx dot com [this message]
2022-03-14 17:15 ` redi at gcc dot gnu.org
2022-03-14 17:22 ` redi at gcc dot gnu.org
2022-03-16 20:13 ` eyalroz1 at gmx dot com
2022-03-16 20:34 ` redi at gcc dot gnu.org
2022-03-16 20:40 ` eyalroz1 at gmx dot com
2022-07-21 21:29 ` redi at gcc dot gnu.org
2022-08-25  9:11 ` manu at gcc dot gnu.org
2022-08-25  9:17 ` manu at gcc dot gnu.org
2022-08-25  9:28 ` redi at gcc dot gnu.org
2009-12-29 14:44 [Bug other/42540] New: " debian-gcc at lists dot debian dot org
2009-12-29 15:06 ` [Bug other/42540] " pinskia at gcc dot gnu dot org
2009-12-29 19:27 ` pinskia at gcc dot gnu dot org
2010-01-06 10:42 ` jwakely dot gcc at gmail dot com
2010-02-24 13:26 ` manu at gcc dot gnu dot org
2010-02-24 14:17 ` rearnsha at gcc dot gnu dot org
2010-07-06 15:47 ` pinskia at gcc dot gnu dot org
2010-07-13 22:56 ` jyasskin at gmail dot com
2010-07-13 22:58 ` pinskia at gcc dot gnu dot org
2010-07-13 22:58 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-42540-4-53V0AsBMi8@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).