This is the mail archive of the 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]
Other format: [Raw text]

Re: PATCH RFA: Fix for g++/7874 (friend injection)

Ian Lance Taylor <> writes:

> Mark Mitchell <> 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
<>, especially my
comment #8, which is another case where we need a timestamp or
something to get templates right with overloading, in

(That is, I think I agree with both of you.)

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