search.c (get_matching_virtual): Note that member templates cannot override virtual functions.

* search.c (get_matching_virtual): Note that member templates
	cannot override virtual functions.

From-SVN: r20497
This commit is contained in:
Mark Mitchell 1998-06-13 23:34:56 +00:00
parent a61e1825f5
commit 5e7955289f
2 changed files with 24 additions and 0 deletions

View File

@ -2232,6 +2232,13 @@ get_matching_virtual (binfo, fndecl, dtorp)
tree tmp = NULL_TREE;
int i;
if (TREE_CODE (fndecl) == TEMPLATE_DECL)
/* In [temp.mem] we have:
A specialization of a member function template does not
override a virtual function from a base class. */
return NULL_TREE;
/* Breadth first search routines start searching basetypes
of TYPE, so we must perform first ply of search here. */
if (dtorp)

View File

@ -0,0 +1,17 @@
// Build don't link:
class base
{
public:
virtual void method()=0;
};
class der: public base
{
public:
template<class C>
void method()
{
C foo;
}
};