[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug other/42540] c++ error message [vtable undefined] is unhelpful



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

Zhihao Yuan <lichray at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lichray at gmail dot com

--- Comment #11 from Zhihao Yuan <lichray at gmail dot com> ---
The example in this bug is not as severe and frequent as the one in bug 44841. 
Users are more likely to encounter this issue when adding a new API to existing
interface or type erasure.

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.

The issue has not been fixed for ten years.  It is a shame rather than some
arcane knowledge that worth to be proud of.

MSVC has no such issue.  The error message reads as "undefined reference to
Class::that_virtual_function."

Some possible fixes:

1. Adjust the error message to say, "The first non-inline, non-pure function
may not have a definition in <Class>."
2. Add extra information to name the key function, and pass it to the linker,
generate an error message to match MSVC's quality.

-- 
You are receiving this mail because:
You reported the bug.

Reply to: