1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
4 @interface Subscriptable
5 - (id)objectForKeyedSubscript:(id)sub __attribute__((unavailable)); // expected-note 2 {{'objectForKeyedSubscript:' has been explicitly marked unavailable here}}
6 - (void)setObject:(id)object forKeyedSubscript:(id)key __attribute__((unavailable)); // expected-note {{'setObject:forKeyedSubscript:' has been explicitly marked unavailable here}}
9 id test(Subscriptable *obj) {
10 obj[obj] = obj; // expected-error {{'setObject:forKeyedSubscript:' is unavailable}}
11 return obj[obj]; // expected-error {{'objectForKeyedSubscript:' is unavailable}}
14 id control(Subscriptable *obj) {
15 return [obj objectForKeyedSubscript:obj]; // expected-error {{'objectForKeyedSubscript:' is unavailable}}