2011/9/23 Jason Merrill <ja...@redhat.com>: > On 09/22/2011 05:11 PM, Fabien Chêne wrote: >> >> 2011/9/22 Jason Merrill<ja...@redhat.com>: > >>> I don't, it just seemed strange to handle functions differently from >>> other >>> decls here. But when I look more closely I see that we're in >>> lookup_field_1, which isn't interested in functions, so I guess we do >>> want >>> to ignore function using-declarations here. >> >> That's strange because if we do return FUNCTION_DECL, PR c++/30195 seems >> solved. > > It works for that testcase, but we need to handle functions in > lookup_fnfields_1 since it's also called from other places.
It tried to add the target declaration of a USING_DECL in the method_vec of the class where the USING_DECL is declared. Thus, I copied the target decl, adjusted its access, and then called add_method with the target decl. Unfortunaltely, it ends up with an undefined reference... struct Base { protected: void *Return () { return this; } }; struct Derived : Base { using Base::Return; }; int main () { Derived d; d.Return(); } In the above example, it behaves as if Derived::Return (introduced via using Base::Return) were not tied to the definition. I do not know where I can fix it, any clues ? Thanks, -- Fabien