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:
parent
a61e1825f5
commit
5e7955289f
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue