bd52d17906
too large to list, but see: http://gcc.gnu.org/gcc-3.4/changes.html http://gcc.gnu.org/gcc-4.0/changes.html http://gcc.gnu.org/gcc-4.1/changes.html for the details.
44 lines
684 B
Plaintext
44 lines
684 B
Plaintext
/* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects. */
|
|
/* { dg-do compile } */
|
|
|
|
#include <objc/Object.h>
|
|
|
|
@interface Object (Test)
|
|
- (Class) test1: (id)object;
|
|
@end
|
|
|
|
@interface Derived: Object
|
|
- (Class) test2: (id)object;
|
|
@end
|
|
|
|
@implementation Object (Test)
|
|
|
|
Class test1(id object) {
|
|
Class cls = object->isa;
|
|
return cls;
|
|
}
|
|
- (Class) test1: (id)object {
|
|
Class cls = object->isa;
|
|
return cls;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation Derived
|
|
|
|
Class test2(id object) {
|
|
Class cls = object->isa;
|
|
return cls;
|
|
}
|
|
- (Class) test2: (id)object {
|
|
Class cls = object->isa;
|
|
return cls;
|
|
}
|
|
|
|
@end
|
|
|
|
Class test3(id object) {
|
|
Class cls = object->isa;
|
|
return cls;
|
|
}
|