Workaround for virtual function/dllimport bug, also patch guidance request
Mumit Khan
khan@nanotech.wisc.edu
Wed Dec 15 15:42:00 GMT 1999
Jason Merrill <jason@cygnus.com> writes:
> >>>>> Mumit Khan <khan@nanotech.wisc.edu> writes:
>
> > The fix is simple -- just import the vtables from the DLL. Currently,
> > config/winnt.c:associated_type returns a NULL context for a vtable,
> > and I don't know how to get to it, so it's not imported correctly.
>
> That's odd; DECL_CONTEXT for the vtable should give the right answer.
I thought so too, but see how the context is assigned *after* calling
cp_finish_decl in class.c:finish_vtbls(). The context for symbols must
be set before any call to make_decl_rtl for the backend to pick the
needed bits in the attributes. That bit about saving the context and
then assigning it again is a bit too deep for me.
> > Re check_override, I've moved it to grokclassfn, and it looks ok so far.
> > Note that I haven't removed it from finish_struct_1 since I'm not sure
> > where else it needs to be added, other than the current one in
> > add_implicitly_declared_members.
>
> Please try removing it from everywhere but grokclassfn and see how that
> works.
Are you sure? Removing it from add_implicitly_declared_members will not
do the right thing, right? I'll submit a patch later.
Regards,
Mumit
More information about the Gcc
mailing list