]> granicus.if.org Git - clang/commitdiff
More test for "void *" argument as index of a dictionary literal.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 10 Sep 2014 22:12:13 +0000 (22:12 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 10 Sep 2014 22:12:13 +0000 (22:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217555 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaObjC/objc-dictionary-literal.m

index 718658e8c9b1020de77cfb183bbf7328a2009c2a..f9fd57f2dae2d7fe4e32af4d032d5745432475b6 100644 (file)
@@ -28,6 +28,7 @@ typedef long NSInteger;
 - (void)setObject:(id)object atIndexedSubscript:(NSInteger)index;
 @end
 
+void *pvoid;
 int main() {
        NSDictionary *dict = @{ @"name":@666 };
         dict[@"name"] = @666;
@@ -37,9 +38,13 @@ int main() {
         // rdar://18254621
         [@{@"foo" : @"bar"} objectForKeyedSubscript:nil];
         (void)@{@"foo" : @"bar"}[nil];
+        [@{@"foo" : @"bar"} objectForKeyedSubscript:pvoid];
+        (void)@{@"foo" : @"bar"}[pvoid];
 
        [@{@"foo" : @"bar"} setObject:nil forKeyedSubscript:@"gorf"];
         @{@"foo" : @"bar"}[nil] = @"gorf";
+       [@{@"foo" : @"bar"} setObject:pvoid forKeyedSubscript:@"gorf"];
+        @{@"foo" : @"bar"}[pvoid] = @"gorf";
 
        return 0;
 }