This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: using decls and template methods
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: "jason at redhat dot com" <jason at redhat dot com>, "gdr at codesourcery dot com" <gdr at codesourcery dot com>
- Date: Wed, 16 Oct 2002 15:27:15 -0700
- Subject: Re: using decls and template methods
--On Wednesday, October 16, 2002 09:24:06 PM +0100 Nathan Sidwell
<nathan@codesourcery.com> wrote:
Hi,
PR 7676 concerns the overloading of template methods of the form
struct A {
template <class T> void Foo ();
template <int I> void Foo ();
};
we erroneously reject this. However, the relevent bit of cp/class.c also
deals with using decls. Consider
struct A {
template <class T> void Foo ();
};
struct B : A {
template <int I> void Foo ();
using A::Foo;
};
is A::Foo overridden or not? (and what if one is a template and the
other not?)
I think that Foo is overloaded in B. (I assume you mean "overloaded" and
not "overridden".)
[7.3.3]/12 says base functions with the same name and parameter types are
overridden. It does not mention 'and same template parameters'.
[13.1]/2 does explicitly mention that the template parameters must also
be the same. (2nd bullet)
Only if one of the functions is static; in this case neither is static.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com