This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
using decls and template methods
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Cc: mark at codesourcery dot com, jason at redhat dot com, gdr at codesourcery dot com
- Date: Wed, 16 Oct 2002 21:24:06 +0100
- Subject: using decls and template methods
- Organization: Codesourcery LLC
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?)
[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)
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org