[LLVMbugs] [Bug 19682] New: Availability attributes ignored for Objective-C subscript access

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 7 11:55:18 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19682

            Bug ID: 19682
           Summary: Availability attributes ignored for Objective-C
                    subscript access
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jordan_rose at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

In the code below, I should get an error on the use of
-objectForKeyedSubscript: via the subscript operator, but I don't. This also
applies to __attribute__((deprecated)) and the various forms of
__attribute__((availability)).


@interface Subscriptable
- (id)objectForKeyedSubscript:(id)sub __attribute__((unavailable));
@end

id test(Subscriptable *obj) {
  return obj[obj]; // no error here!
}

id control(Subscriptable *obj) {
  return [obj objectForKeyedSubscript:obj]; // error as expected
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140507/d2851de4/attachment.html>


More information about the llvm-bugs mailing list