diff options
Diffstat (limited to 'test/SemaObjCXX/properties.mm')
-rw-r--r-- | test/SemaObjCXX/properties.mm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/SemaObjCXX/properties.mm b/test/SemaObjCXX/properties.mm index 804d6829b1..abd4db998b 100644 --- a/test/SemaObjCXX/properties.mm +++ b/test/SemaObjCXX/properties.mm @@ -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]; + } +} |