summaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorzlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-26 21:17:20 +0000
committerzlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-26 21:17:20 +0000
commitfa938c8f4e9f54b17958495d89727d2da08f4d2f (patch)
tree3388479481cefd3623d402e7f48a82fd69547159 /gcc/objc
parent9a2a66aec88d8d9712fd73d402796d729efc33db (diff)
downloadgcc-fa938c8f4e9f54b17958495d89727d2da08f4d2f.tar.gz
[gcc]
2002-08-26 Ziemowit Laski <zlaski@apple.com> * objc/objc-act.c (get_super_receiver): If inside a class method of a category, cast the receiver to 'id' before accessing the 'isa' field so that <objc/objc-class.h> is not needed. For NeXT runtime. [gcc/testsuite] 2002-08-26 Ziemowit Laski <zlaski@apple.com> * objc.dg/super-class-2.m: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56587 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/objc-act.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index e1c630d6be6..08193691369 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -7042,9 +7042,13 @@ get_super_receiver ()
{
super_class = get_class_reference (super_name);
if (TREE_CODE (objc_method_context) == CLASS_METHOD_DECL)
+ /* Cast the super class to 'id', since the user may not have
+ included <objc/objc-class.h>, leaving 'struct objc_class'
+ an incomplete type. */
super_class
- = build_component_ref (build_indirect_ref (super_class, "->"),
- get_identifier ("isa"));
+ = build_component_ref (build_indirect_ref
+ (build_c_cast (id_type, super_class), "->"),
+ get_identifier ("isa"));
}
else
{