This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Better document two-stage name lookup & template base classes,take 2
On Tue, 2003-07-22 at 09:44, Wolfgang Bangerth wrote:
>
> > > > I have the impression that we try to do it _all_ right already now.
> > > > Should this be reworded thus?
> >
> > I *think* so.
>
> OK, I changed that in the manual, too, then.
>
>
> > This paragraph, which I know you didn't write, isn't as tight as it
> > could be. How about: [...]
>
> I fixed it. And I _did_ write the paragraph, but in a patch a couple of weeks
> (months?) ago :-)
>
> The patch I'll commit after bootstrapping is attached below.
>
> Regarding this:
>
> > I hadn't thought that we would get this case:
> >
> > int f(int) { return 1; }
> > template <typename T> int g(T) { return f('a'); }
> > int f(char) { return 2; }
> > int main () {
> > return g(3);
> > }
> >
> > right, but it turns out that my implementation of this stuff gets this
> > case right automatically. (The point is that "f('a')" should call
> > "f(int)", not "f(char)".)
Geesh! The part above this is correct -- but this next paragraph:
> > void f(int);
> > template <typename T> void g(T) { f('a'); }
> > void f(char);
> > template void g(double);
> >
> > will, I think, result in a call to "f(char)", not "f(int)". I hope to
> > fix this at some point in the relatively near future, but it's somewhat
> > tricky.
was from an earlier draft of my message and should have been omitted!
Just pretend like it wasn't there...
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com