diff options
Diffstat (limited to 'test/SemaObjCXX/properties.mm')
-rw-r--r-- | test/SemaObjCXX/properties.mm | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/test/SemaObjCXX/properties.mm b/test/SemaObjCXX/properties.mm index 0783eeb..abd4db9 100644 --- a/test/SemaObjCXX/properties.mm +++ b/test/SemaObjCXX/properties.mm @@ -28,7 +28,7 @@ struct X { - (int) z; @end void test2(Test2 *a) { - auto y = a.y; // expected-error {{expected getter method not found on object of type 'Test2 *'}} + auto y = a.y; // expected-error {{no getter method for read from property}} auto z = a.z; } @@ -129,3 +129,38 @@ extern void* VoidType; extern decltype(TestNonTrivialObj.p1 = NonTrivial1())* VoidType; extern decltype(TestNonTrivialObj.p2 = NonTrivial2())* VoidType; +// rdar://13332183 +namespace test9 { + struct CString { + const char *_data; + char operator[](int i) const { return _data[i]; } + }; +} +@interface Test9 +@property test9::CString name; +@end +namespace test9 { + char test(Test9 *t) { + return t.name[0]; + } +} + +namespace test10 { + struct A { operator const char*(); }; + struct B { operator const char*(); }; +} +@interface Test10 +@property test10::A a; +@property test10::B b; +@property int index; +@end +namespace test10 { + void test(Test10 *t) { + (void) t.a[6]; + (void) 6[t.b]; + (void) "help"[t.index]; + (void) t.index["help"]; + (void) t.a[t.index]; + (void) t.index[t.b]; + } +} |