<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hello everyone,</div><div><br></div><div>I just found out the metadata generated by the compiler does not include the weak attribute of a property.</div><div><br></div><div>Here is the test code:</div><div><br></div><div><a href="https://gist.github.com/518fddd28144e58f3974">https://gist.github.com/518fddd28144e58f3974</a></div><div><br></div><div>Here is the diff to correct that bug:</div><div><br></div><div><div>Index: include/clang/AST/DeclObjC.h</div><div>===================================================================</div><div>--- include/clang/AST/DeclObjC.h<span class="Apple-tab-span" style="white-space:pre">  </span>(revision 137478)</div><div>+++ include/clang/AST/DeclObjC.h<span class="Apple-tab-span" style="white-space:pre">    </span>(working copy)</div><div>@@ -1429,7 +1429,7 @@</div><div>     NumPropertyAttrsBits = 12</div><div>   };</div><div> </div><div>-  enum SetterKind { Assign, Retain, Copy };</div><div>+  enum SetterKind { Assign, Retain, Copy, Weak };</div><div>   enum PropertyControl { None, Required, Optional };</div><div> private:</div><div>   SourceLocation AtLoc;   // location of @property</div><div>@@ -1509,6 +1509,8 @@</div><div>       return Retain;</div><div>     if (PropertyAttributes & OBJC_PR_copy)</div><div>       return Copy;</div><div>+    if (PropertyAttributes & OBJC_PR_weak)</div><div>+      return Weak;</div><div>     return Assign;</div><div>   }</div><div> </div><div>Index: lib/AST/ASTContext.cpp</div><div>===================================================================</div><div>--- lib/AST/ASTContext.cpp<span class="Apple-tab-span" style="white-space:pre">       </span>(revision 137478)</div><div>+++ lib/AST/ASTContext.cpp<span class="Apple-tab-span" style="white-space:pre">  </span>(working copy)</div><div>@@ -4078,6 +4078,7 @@</div><div>     case ObjCPropertyDecl::Assign: break;</div><div>     case ObjCPropertyDecl::Copy:   S += ",C"; break;</div><div>     case ObjCPropertyDecl::Retain: S += ",&"; break;</div><div>+    case ObjCPropertyDecl::Weak:   S += ",W"; break;</div><div>     }</div><div>   }</div></div><div><br></div><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="font-family: 'Comic Sans MS'; font-size: 12px; ">____________________________________</div><div style="font-family: 'Comic Sans MS'; font-size: 12px; ">Remy Demarest</div><div style="font-family: 'Comic Sans MS'; font-size: 12px; "><a href="mailto:remy.demarest@gmail.com">remy.demarest@gmail.com</a></div><div style="font-family: 'Comic Sans MS'; font-size: 12px; ">+1 (647) 862-1779</div></div></div>
</div>
<br></body></html>