https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62051
--- Comment #27 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #26) > That is Base and Derived in the shared library and the main program are > considered two different classes because of -fvisibility=hidden and the > classes are not marked as visibility default. Symbol visibility is outside the language, and doesn't affect mangling, so I don't think it's accurate to say they are considered two different classes. It seems to me they are the same classes, with controlled access to the implementation.