[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

Devin Coughlin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 9 08:58:03 PST 2016


dcoughlin added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp:44
+                                           BugReporter &BR) const {
+  if (D->isReadOnly() || D->getSetterKind() != ObjCPropertyDecl::Copy)
+    return;
----------------
It is probably worth adding a test that the checker still issues a diagnostic when a readonly property in the primary interface is 'shadowed' by a readwrite property in a class extension. This is a very common idiom which lets the programmer expose the property as readonly in public but readwrite in private.


https://reviews.llvm.org/D27535





More information about the cfe-commits mailing list