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
4 typedef unsigned long size_t;
6 void *sel_registerName(const char *);
10 @interface NSMutableArray
11 #if __has_feature(objc_subscripting)
12 - (id)objectAtIndexedSubscript:(size_t)index;
13 - (void)setObject:(id)object atIndexedSubscript:(size_t)index;
17 #if __has_feature(objc_subscripting)
18 @interface XNSMutableArray
19 - (id)objectAtIndexedSubscript:(size_t)index;
20 - (void)setObject:(id)object atIndexedSubscript:(size_t)index;
24 @interface NSMutableDictionary
25 - (id)objectForKeyedSubscript:(id)key;
26 - (void)setObject:(id)object forKeyedSubscript:(id)key;
32 NSMutableArray<P> * array;
33 id oldObject = array[10];
35 array[10] = oldObject;
38 oldObject = unknown_array[1];
40 unknown_array[1] = oldObject;
42 NSMutableDictionary *dictionary;
45 oldObject = dictionary[key];
46 dictionary[key] = newObject; // replace oldObject with newObject