diff options
author | Ziemowit Laski <zlaski@apple.com> | 2001-09-06 00:26:34 +0000 |
---|---|---|
committer | Stan Shebs <shebs@gcc.gnu.org> | 2001-09-06 00:26:34 +0000 |
commit | 89fc36051e8045d8bb086b3228c1aec280884097 (patch) | |
tree | f5f3d8aa668421ed73489dd49d533e1aed497a2a /gcc/objc/objc-act.c | |
parent | 2d25bf5d526dae1fbeffc3dbc88b75d824b27ea9 (diff) | |
download | gcc-89fc36051e8045d8bb086b3228c1aec280884097.zip gcc-89fc36051e8045d8bb086b3228c1aec280884097.tar.gz gcc-89fc36051e8045d8bb086b3228c1aec280884097.tar.bz2 |
objc-act.c (build_message_expr): If a class method cannot be found...
2001-09-05 Ziemowit Laski <zlaski@apple.com>
* objc/objc-act.c (build_message_expr): If a class method cannot
be found, do not issue a warning if a corresponding instance
method exists in the root class.
2001-09-05 Ziemowit Laski <zlaski@apple.com>
* objc.dg/method-2.m: New.
From-SVN: r45428
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r-- | gcc/objc/objc-act.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 3ff7045..358d0ea 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -5177,8 +5177,7 @@ build_message_expr (mess) method_prototype = lookup_class_method_static (iface, sel_name); } - if (!method_prototype - || TREE_CODE (method_prototype) != CLASS_METHOD_DECL) + if (!method_prototype) { warning ("cannot find class (factory) method."); warning ("return type for `%s' defaults to id", @@ -5687,7 +5686,9 @@ lookup_class_method_static (interface, ident) } while (inter); - /* Simulate wrap around. */ + /* If no class (factory) method was found, check if an _instance_ + method of the same name exists in the root class. This is what + the Objective-C runtime will do. */ return lookup_instance_method_static (root_inter, ident); } |