This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Make dllimport/dllexport imply default visibility
Chris Lattner wrote:
> This construct seems like it should be rejected by the C++ front-end.
> The source is making two contradictory claims: the struct is not visible
> outside this library, but part of it is implemented outside of it.
I don't think there's a contradiction. The declaration on the structure
is the default for the members and applies to the vtable and other class
data. There's no reason the members shouldn't be implemented elsewhere,
and there's certainly existing code (in Windows, SymbianOS, and other
DLL-based operating systems, whether or not there is on GNU/Linux) that
implements different class members in different DLLs, while still not
exporting the class from its home DLL. One situation where this is
useful is when the class members are actually shared between multiple
classes, or are also callable as C functions, etc.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713