<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 --- - Analyzer doesn't recognize under retain in Obj-C setter"
   href="http://llvm.org/bugs/show_bug.cgi?id=19746">19746</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Analyzer doesn't recognize under retain in Obj-C setter
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>seth@freaksw.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>Given the code below, I'd expect the analyzer to tell me I didn't retain or
copy the NSString and have under-retained it.



This is the simplest case:


@interface Foo : NSObject
@property (nonatomic, readwrite, copy) NSString * property;
@end


@implementation Foo
{
    NSString * _property;
}


- (void)dealloc
{
    [_property release];
    [super dealloc];
}


- (void)setProperty:(NSString *)property;
{
    [_property autorelease];
    _property = property;  // should be [property copy]
}


- (NSString *)property;
{
    return _property;
}


@end</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>