2011/9/22 Jason Merrill <ja...@redhat.com>: > On 09/22/2011 04:22 AM, Fabien Chêne wrote: >> >> I would have thought that we want to do something with OVERLOAD here, >> in order to get rid of PR c++/30195 and c++/25994 (removing a wrong >> diagnostic additionaly)... But those PRs are already fixed by this >> patch without doing anything with OVERLOAD. Consequently, I don't >> really know why it would be needed, but I can certainly do it if you >> prefer. Have you got an example in mind where it would be needed ? > > 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. > But check for is_overloaded_fn rather than just OVERLOAD. Also, it looks > like the new code doesn't respect want_type. Er, I'm a bit lost, do you mean something like that ? if (TREE_CODE (field) == USING_DECL) { tree target_field = strip_using_decl (field); if (target_field != field) { if (DECL_P (target_field) && DECL_NAME (target_field) == name || (is_overloaded_fn (target_field) && DECL_NAME (get_first_fn (target_field)) == name)) { if (!want_type || TREE_CODE (target_field) == TYPE_DECL) return target_field; } continue; } } Thanks, -- Fabien