<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Clang is missing the 'retain' code (&) when returning property_getAttributes"
href="http://llvm.org/bugs/show_bug.cgi?id=15928">15928</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang is missing the 'retain' code (&) when returning property_getAttributes
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.1
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Headers
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>justincohen@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>#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.
*/</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>