1 /* Test that all pending instantiations have taken place before meta-data
3 /* Author: Fariborz Jahanian <fjahanian@apple.com> */
4 /* Adapted by Nicola Pero <nicola.pero@meta-innovation.com> */
6 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
9 #include <objc/runtime.h>
11 @interface MyRootClass
19 @implementation MyRootClass
20 + (id) initialize { return self; }
21 + alloc { return class_createInstance (self, 0); }
22 - init { return self; }
23 - doSomething { return self; }
32 void destroy() { delete this; }
36 class Subclass : public T
43 [[[MyRootClass alloc] init] doSomething];
47 int main(int argc, const char * argv[])
49 Subclass<Base>* theSubclass = new Subclass<Base>();
50 theSubclass->destroy();