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.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/305460

Title:
  [PR42540] c++ error message [vtable undefined] is unhelpful

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/305460/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to