Mercurial > hg > CbC > CbC_llvm
comparison clang/test/SemaObjC/objc-container-subscripting.m @ 236:c4bab56944e8 llvm-original
LLVM 16
author | kono |
---|---|
date | Wed, 09 Nov 2022 17:45:10 +0900 |
parents | 1d019706d866 |
children |
comparison
equal
deleted
inserted
replaced
232:70dce7da266c | 236:c4bab56944e8 |
---|---|
8 - (void)setObject:(id *)object atIndexedSubscript:(void *)index; // expected-note {{parameter of type 'void *' is declared here}} \ | 8 - (void)setObject:(id *)object atIndexedSubscript:(void *)index; // expected-note {{parameter of type 'void *' is declared here}} \ |
9 // expected-note {{parameter of type 'id *' is declared here}} | 9 // expected-note {{parameter of type 'id *' is declared here}} |
10 @end | 10 @end |
11 @interface I @end | 11 @interface I @end |
12 | 12 |
13 int main() { | 13 int main(void) { |
14 NSMutableArray<P> * array; | 14 NSMutableArray<P> * array; |
15 id oldObject = array[10]; // expected-error {{method index parameter type 'double' is not integral type}} | 15 id oldObject = array[10]; // expected-error {{method index parameter type 'double' is not integral type}} |
16 array[3] = 0; // expected-error {{method index parameter type 'void *' is not integral type}} \ | 16 array[3] = 0; // expected-error {{method index parameter type 'void *' is not integral type}} \ |
17 // expected-error {{cannot assign to this array because assigning method's 2nd parameter of type 'id *' is not an Objective-C pointer type}} | 17 // expected-error {{cannot assign to this array because assigning method's 2nd parameter of type 'id *' is not an Objective-C pointer type}} |
18 | 18 |
30 - (void)setObject:(void*)object forKeyedSubscript:(id*)key; // expected-note {{parameter of type 'void *' is declared here}} \ | 30 - (void)setObject:(void*)object forKeyedSubscript:(id*)key; // expected-note {{parameter of type 'void *' is declared here}} \ |
31 // expected-note {{parameter of type 'id *' is declared here}} | 31 // expected-note {{parameter of type 'id *' is declared here}} |
32 @end | 32 @end |
33 @class NSString; | 33 @class NSString; |
34 | 34 |
35 void testDict() { | 35 void testDict(void) { |
36 NSMutableDictionary *dictionary; | 36 NSMutableDictionary *dictionary; |
37 NSString *key; | 37 NSString *key; |
38 id newObject, oldObject; | 38 id newObject, oldObject; |
39 oldObject = dictionary[key]; // expected-error {{method key parameter type 'id *' is not object type}} | 39 oldObject = dictionary[key]; // expected-error {{method key parameter type 'id *' is not object type}} |
40 dictionary[key] = newObject; // expected-error {{method object parameter type 'void *' is not object type}} \ | 40 dictionary[key] = newObject; // expected-error {{method object parameter type 'void *' is not object type}} \ |