[LLVMbugs] [Bug 15928] New: Clang is missing the 'retain' code (&) when returning property_getAttributes
    bugzilla-daemon at llvm.org 
    bugzilla-daemon at llvm.org
       
    Tue May  7 10:16:59 PDT 2013
    
    
  
http://llvm.org/bugs/show_bug.cgi?id=15928
            Bug ID: 15928
           Summary: Clang is missing the 'retain' code (&) when returning
                    property_getAttributes
           Product: clang
           Version: 3.1
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Headers
          Assignee: unassignedclangbugs at nondot.org
          Reporter: justincohen at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified
#import <Cocoa/Cocoa.h>
#import <objc/objc-class.h>
@interface Sample : NSObject
@property(nonatomic, readonly, retain) NSObject* readonlyObject;
@property(nonatomic, readwrite, retain) NSObject* readwriteObject;
@end
@implementation Sample
@synthesize readonlyObject = readonlyObject_;
@synthesize readwriteObject = readwriteObject_;
@end
int main(int argc, char *argv[]) {
  id SampleClass = objc_getClass("Sample");
  unsigned int outCount, i;
  objc_property_t *properties =
      class_copyPropertyList(SampleClass, &outCount);
  for (i = 0; i < outCount; i++) {
    objc_property_t property = properties[i];
    fprintf(stdout, "%s %s\n", 
        property_getName(property), 
        property_getAttributes(property));
  }
}
/*
clang -c main.m -o main.o
clang -o main main.o -framework Foundation
$ gcc -c main.m -o main.o; gcc -o main main.o -framework Foundation; ./main
readonlyObject T@"NSObject",R,&,N,VreadonlyObject_
readwriteObject T@"NSObject",&,N,VreadwriteObject_
$ clang -c main.m -o main.o; clang -o main main.o -framework Foundation; ./main
readwriteObject T@"NSObject",&,N,VreadwriteObject_
readonlyObject T@"NSObject",R,N,VreadonlyObject_
Clang is missing the & for the readonly property.
*/
-- 
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/20130507/50eee821/attachment.html>
    
    
More information about the llvm-bugs
mailing list