phunix/external/bsd/llvm/dist/clang/test/SemaObjC/objc-container-subscripting-attr.m
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

19 lines
818 B
Objective-C

// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// rdar://16842487
// pr19682
@interface Subscriptable
- (id)objectForKeyedSubscript:(id)sub __attribute__((unavailable)); // expected-note 2 {{'objectForKeyedSubscript:' has been explicitly marked unavailable here}}
- (void)setObject:(id)object forKeyedSubscript:(id)key __attribute__((unavailable)); // expected-note {{'setObject:forKeyedSubscript:' has been explicitly marked unavailable here}}
@end
id test(Subscriptable *obj) {
obj[obj] = obj; // expected-error {{'setObject:forKeyedSubscript:' is unavailable}}
return obj[obj]; // expected-error {{'objectForKeyedSubscript:' is unavailable}}
}
id control(Subscriptable *obj) {
return [obj objectForKeyedSubscript:obj]; // expected-error {{'objectForKeyedSubscript:' is unavailable}}
}