brintos

brintos / llvm-project-archived public Read only

0
0
Text · 799 B · da421cf Raw
18 lines · plain
1// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s2// pr196823 4@interface Subscriptable5- (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}}7@end8 9id test(Subscriptable *obj) {10  obj[obj] = obj;  // expected-error {{'setObject:forKeyedSubscript:' is unavailable}}11  return obj[obj]; // expected-error {{'objectForKeyedSubscript:' is unavailable}}12}13 14id control(Subscriptable *obj) {15  return [obj objectForKeyedSubscript:obj]; // expected-error {{'objectForKeyedSubscript:' is unavailable}}16}17 18