Commit 3d1df1fa by Mark Mitchell Committed by Mark Mitchell

re PR c++/9791 (-Woverloaded-virtual reports hiding of destructor)

	PR c++/9791
	* class.c (get_basefndecls): Use lookup_fnfields_1.

	PR c++/9791
	* g++.dg/warn/Woverloaded-1.C: New test.

From-SVN: r63899
parent f3922fd2
2003-03-06 Mark Mitchell <mark@codesourcery.com>
PR c++/9791
* class.c (get_basefndecls): Use lookup_fnfields_1.
2003-03-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9188
......
......@@ -2524,11 +2524,19 @@ get_basefndecls (tree name, tree t)
int n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
int i;
for (methods = TYPE_METHODS (t); methods; methods = TREE_CHAIN (methods))
if (TREE_CODE (methods) == FUNCTION_DECL
&& DECL_VINDEX (methods) != NULL_TREE
&& DECL_NAME (methods) == name)
base_fndecls = tree_cons (NULL_TREE, methods, base_fndecls);
/* Find virtual functions in T with the indicated NAME. */
i = lookup_fnfields_1 (t, name);
if (i != -1)
for (methods = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), i);
methods;
methods = OVL_NEXT (methods))
{
tree method = OVL_CURRENT (methods);
if (TREE_CODE (method) == FUNCTION_DECL
&& DECL_VINDEX (method))
base_fndecls = tree_cons (NULL_TREE, method, base_fndecls);
}
if (base_fndecls)
return base_fndecls;
......
2003-03-06 Mark Mitchell <mark@codesourcery.com>
PR c++/9791
* g++.dg/warn/Woverloaded-1.C: New test.
Wed Mar 5 23:18:11 CET 2003 Jan Hubicka <jh@suse.cz>
* gcc.dg/i386-local2.c: New.
......
/* { dg-options "-Woverloaded-virtual" } */
class Base {
public:
virtual ~Base() {
}
};
class Derived: public Base {
public:
int Base() { // There should be no error here.
return 5;
}
};
int main() {
}
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