diff options
-rw-r--r-- | test/SemaObjCXX/properties.mm | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/test/SemaObjCXX/properties.mm b/test/SemaObjCXX/properties.mm index 7ea8a48e4b..d8d92e5687 100644 --- a/test/SemaObjCXX/properties.mm +++ b/test/SemaObjCXX/properties.mm @@ -46,15 +46,25 @@ namespace std { template<typename T> void count(); } -@interface Test4 { +@interface Test4 +- (X&) prop; +@end + +void test4(Test4 *t) { + (void)const_cast<const X&>(t.prop); + (void)dynamic_cast<X&>(t.prop); + (void)reinterpret_cast<int&>(t.prop); +} + +@interface Test5 { @public int count; } @property int count; @end -void test4(Test4* t4) { - if (t4.count < 2) { } - if (t4->count < 2) { } +void test5(Test5* t5) { + if (t5.count < 2) { } + if (t5->count < 2) { } } |