[PATCH] D25844: [Sema][ObjC] Warn about implicitly autoreleasing indirect parameters that are captured by blocks

John McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 22:13:48 PDT 2016


rjmccall added inline comments.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:5080
+def note_explicit_ownership_qualification : Note<
+  "explicitly specify ownership qualification">;
+
----------------
How about:
  warning: block captures an autoreleasing out-parameter, which may result in use-after-free bugs
  note: declare the parameter __autoreleasing explicitly to suppress this warning  (include a fixit on this one)
  note: declare the parameter __strong or capture a __block __strong variable to keep values alive across autorelease pools


https://reviews.llvm.org/D25844





More information about the cfe-commits mailing list