This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: Fix for g++/7874 (friend injection)
Ian Lance Taylor <ian@airs.com> writes:
> Mark Mitchell <mark@codesourcery.com> writes:
>
> > I'm a little unhappy about remove_hidden_names, as that will make
> > multiple copies of the same overload set over and over and over again.
> > However, you can't rely on a bit on the FUNCTION_DECL itself as early
> > users of the function name should not see the declaration, even if later
> > users do (because of an explicit namespace-scope declaration). (This
> > matters in templates, for two-phase lookup.)
> >
> > The way to fix this is to use a (logical) timestamp; the person holding
> > the OVERLOAD should also hold a timestamp indicating when they did the
> > lookup. Then, the FUNCTION_DECL has a timestamp saying at which point
> > it became non-hidden. Then, you can figure out what the really visible
> > set of overloads is when you need to use them.
>
> Well, I agree with you, but it also seems to me that that's more or
> less true of the whole set of functions under lookup_arg_dependent--
> they compute the same overload set again and again.
You might want to look at
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635>, especially my
comment #8, which is another case where we need a timestamp or
something to get templates right with overloading, in
lookup_arg_dependent.
(That is, I think I agree with both of you.)