Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / obj-c++.dg / isa-field-1.mm
blobf6d3e6a475cd81f6603a40ee2203472cedc3b6fd
1 /* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects.  */
2 /* { dg-do compile } */
3 /* { dg-xfail-if "PR23613" { "*-*-*" } { "*" } { "" } } */
5 #include <objc/Object.h>
7 @interface Object (Test)
8 - (Class) test1: (id)object;
9 @end
11 @interface Derived: Object
12 - (Class) test2: (id)object;
13 @end
15 @implementation Object (Test)
17 Class test1(id object) {
18   Class cls = object->isa;
19   return cls;
21 - (Class) test1: (id)object {
22   Class cls = object->isa;
23   return cls;
26 @end
28 @implementation Derived
30 Class test2(id object) {
31   Class cls = object->isa;
32   return cls;
34 - (Class) test2: (id)object {
35   Class cls = object->isa;
36   return cls;
39 @end
41 Class test3(id object) {
42   Class cls = object->isa;
43   return cls;