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
5 // -Did="void*" -DSEL="void *" -DClass="void*"
6 @interface NSMutableArray {
11 typedef unsigned char BOOL;
12 typedef unsigned long NSUInteger;
14 __attribute__((visibility("hidden")))
15 @interface __NSArrayM : NSMutableArray {
17 NSUInteger _doHardRetain:1;
18 NSUInteger _doWeakAccess:1;
24 NSUInteger _hasObjects:1;
25 NSUInteger _hasStrongReferences:1;
27 NSUInteger _offset:62;
29 NSUInteger _offset:30;
31 unsigned long _mutations;
37 id __CFAllocateObject2();
38 BOOL objc_collectingEnabled();
40 @implementation __NSArrayM
41 + (id)__new:(const id [])objects :(NSUInteger)count :(BOOL)hasObjects :(BOOL)hasStrong :(BOOL)transferRetain {
42 __NSArrayM *newArray = (__NSArrayM *)__CFAllocateObject2();
43 newArray->_size = count;
44 newArray->_mutations = 1;
45 newArray->_doHardRetain = (hasObjects && hasStrong);
46 newArray->_doWeakAccess = (objc_collectingEnabled() && !hasStrong);
47 newArray->_hasObjects = hasObjects;
48 newArray->_hasStrongReferences = hasStrong;
50 return *newArray->_list;
60 @interface A : Super {
77 return a->ivar_ext_a + a->ivar_a;
87 return a->ivar_ext2_a + a->ivar_ext_a + a->ivar_a;
99 return a->ivar_d + a->ivar_ext2_a + a->ivar_ext_a + a->ivar_a;
102 __attribute__((objc_root_class)) @interface Base
104 struct objc_class *isa;
120 @implementation Base @end