1 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2 // RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
5 typedef unsigned long size_t;
7 void *sel_registerName(const char *);
11 @interface NSMutableArray
12 #if __has_feature(objc_subscripting)
13 - (id)objectAtIndexedSubscript:(size_t)index;
14 - (void)setObject:(id)object atIndexedSubscript:(size_t)index;
18 #if __has_feature(objc_subscripting)
19 @interface XNSMutableArray
20 - (id)objectAtIndexedSubscript:(size_t)index;
21 - (void)setObject:(id)object atIndexedSubscript:(size_t)index;
25 @interface NSMutableDictionary
26 - (id)objectForKeyedSubscript:(id)key;
27 - (void)setObject:(id)object forKeyedSubscript:(id)key;
33 NSMutableArray<P> * array;
34 id oldObject = array[10];
36 array[10] = oldObject;
39 oldObject = unknown_array[1];
41 unknown_array[1] = oldObject;
43 NSMutableDictionary *dictionary;
46 oldObject = dictionary[key];
47 dictionary[key] = newObject; // replace oldObject with newObject