diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/SemaObjCXX/properties.mm | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
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]; + } +} |