This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to fix support of C++ dllimports


Jason Merrill <jason@cygnus.com> writes:
> 
> > Jason, any side effect of peeking into TREE_TYPE(enclosing_type)?
> 
> No, but that's relying on an implementation detail of the C++ frontend; I'd
> rather implement this in a more general way.  And, of course, it doesn't
> work if the attributes are specified after the class.

It's crude, but this fix is needed for making C++ static class variables
work when imported from a DLL.

I agree that this kludge doesn't work when the attribute is specified
*after* the class; one consolation however is that MSVC can't handle 
it either, and no existing code will use it as such.

Your call obviously.

After 1.1 is out, I'll submit a patch that adds first-class attributes 
for dllimport/dllexport which will obviate the current check for machine 
decl/type attributes in the C++ front-end (decl2.cc:import_export_class), 
and hopefully will ease the process of doing this right.

Regards,
Mumit


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]