This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/64670] -fsanitize=vptr leads to "undefined reference to `typeinfo for class'"
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Feb 2015 16:23:12 +0000
- Subject: [Bug sanitizer/64670] -fsanitize=vptr leads to "undefined reference to `typeinfo for class'"
- Auto-submitted: auto-generated
- References: <bug-64670-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64670
--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #9)
> In the real code, one has something like the following, which I tried to
> mimic in the test case. If I understood your comment correctly, I should use
> in "log.c" not only 'implementation "log.h"' but additionally(?)
> 'implementation "LogListener.h"' - i.e. using 'pragma implementation' for
> LogListener.h's classes only in LogListener.h is not sufficient?
Having #pragma implementation in LogListener.cc is sufficient:
> The real-world LogListener.o has (full output as it is short):
...
> 0000000000000000 V typeinfo for LogListener
So why are you getting an undefined reference?