<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 --- - Add warning to indicate when ARC implicit writeback occurs"
   href="http://llvm.org/bugs/show_bug.cgi?id=19009">19009</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Add warning to indicate when ARC implicit writeback occurs
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </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>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tjw@me.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>Created <span class=""><a href="attachment.cgi?id=12171" name="attach_12171" title="patch">attachment 12171</a> <a href="attachment.cgi?id=12171&action=edit" title="patch">[details]</a></span>
patch

Split out from <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Warn about using a variable as __strong and __autoreleasing at the same time"
   href="show_bug.cgi?id=15649">http://llvm.org/bugs/show_bug.cgi?id=15649</a>

In some cases, ARC implicit writeback can result in loss of what the user
likely intended. For example:

    int main(int argc, char *argv[])
    {
        __block id value = @"initial value";
        void (^block)(id *outValue) = ^(id *outValue){
            value = @"hello";
        };
        block(&value);
        NSLog(@"value = %@", value);
        return 0;
    }

With ARC, this reports:

    2013-04-24 13:55:35.814 block-local-address[28013:707] value = initial
value

but with MRR:

    2013-04-24 13:57:26.058 block-local-address[28046:707] value = hello

Attached is a patch vs trunk r202532 that adds -Warc-implicit-writeback and
test cases for the ObjC and ObjC++ compilers (which each seem to have their own
support for writeback).</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>