1 // RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
2 // RUN: %clang_cc1 -fsyntax-only -std=gnu++98 -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
4 // -Did="void*" -DSEL="void *" -DClass="void*"
5 @interface NSMutableArray {
10 typedef unsigned char BOOL;
11 typedef unsigned long NSUInteger;
13 __attribute__((visibility("hidden")))
14 @interface __NSArrayM : NSMutableArray {
16 NSUInteger _doHardRetain:1;
17 NSUInteger _doWeakAccess:1;
23 NSUInteger _hasObjects:1;
24 NSUInteger _hasStrongReferences:1;
26 NSUInteger _offset:62;
28 NSUInteger _offset:30;
30 unsigned long _mutations;
36 id __CFAllocateObject2();
37 BOOL objc_collectingEnabled();
39 @implementation __NSArrayM
40 + (id)__new:(const id [])objects :(NSUInteger)count :(BOOL)hasObjects :(BOOL)hasStrong :(BOOL)transferRetain {
41 __NSArrayM *newArray = (__NSArrayM *)__CFAllocateObject2();
42 newArray->_size = count;
43 newArray->_mutations = 1;
44 newArray->_doHardRetain = (hasObjects && hasStrong);
45 newArray->_doWeakAccess = (objc_collectingEnabled() && !hasStrong);
46 newArray->_hasObjects = hasObjects;
47 newArray->_hasStrongReferences = hasStrong;
49 return *newArray->_list;
59 @interface A : Super {
76 return a->ivar_ext_a + a->ivar_a;
86 return a->ivar_ext2_a + a->ivar_ext_a + a->ivar_a;
98 return a->ivar_d + a->ivar_ext2_a + a->ivar_ext_a + a->ivar_a;
101 __attribute__((objc_root_class)) @interface Base
103 struct objc_class *isa;
119 @implementation Base @end