diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-03-06 20:06:29 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-03-06 20:06:29 +0000 |
commit | 3d1df1fa6beec8f46864e4698cb5d762548998e2 (patch) | |
tree | 184ac8f172c4e03b8748ef74fc3e06ba7cd2d5a3 /gcc/cp | |
parent | f3922fd2682929596da68ce0ec33ab02ddb775a2 (diff) | |
download | gcc-3d1df1fa6beec8f46864e4698cb5d762548998e2.zip gcc-3d1df1fa6beec8f46864e4698cb5d762548998e2.tar.gz gcc-3d1df1fa6beec8f46864e4698cb5d762548998e2.tar.bz2 |
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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/class.c | 18 |
2 files changed, 18 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8668f78..7d62350 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 433e426..6b89bec 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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; |