+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
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.
--- /dev/null
+/* { 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() {
+}