This is the mail archive of the gcc@gcc.gnu.org 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]

using decls and template methods


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



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