Commit 5e795528 by Mark Mitchell

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
parent a61e1825
......@@ -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)
......
// Build don't link:
class base
{
public:
virtual void method()=0;
};
class der: public base
{
public:
template<class C>
void method()
{
C foo;
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment