NoQ updated this revision to Diff 81083.
NoQ added a comment.
- Fix crashes on checking properties in categories.
- Address both comments.
https://reviews.llvm.org/D27535
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/CMakeLists.txt
zaks.anna added inline comments.
Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:494
+def ObjCPropertyChecker : Checker<"ObjCProperty">,
+ HelpText<"Find various issues with Objective-C properties">,
+ DescFile<"ObjCPropertyChecker.cpp">;
Nit:
dcoughlin added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp:44
+ BugReporter ) const {
+ if (D->isReadOnly() || D->getSetterKind() != ObjCPropertyDecl::Copy)
+return;
It is
NoQ updated this revision to Diff 80811.
NoQ added a comment.
Don't yell at read-only properties (no -copy is performed).
Single-quote 'copy' in the error messages.
https://reviews.llvm.org/D27535
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
NoQ updated this revision to Diff 80756.
NoQ added a comment.
Don't construct a `StringRef` to a temporary `std::string`.
https://reviews.llvm.org/D27535
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/CMakeLists.txt
NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp:68
+return;
+
+ BR.EmitBasicReport(
dcoughlin wrote:
> You'll also want to make sure to not warn on the following idiom, in which
> programmers use @synthesize to
NoQ updated this revision to Diff 80751.
NoQ marked an inline comment as done.
NoQ added a comment.
- Address comments
- Richer warning message (is it in good shape?)
- Add tests for lack of implementation
https://reviews.llvm.org/D27535
Files:
dcoughlin added a comment.
This looks great to me other than the idiom I mentioned inline (which is
common, as I have found to my chagrin).
Comment at: lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp:12
+// Currently finds only one kind of issue:
+// - Find
NoQ created this revision.
NoQ added reviewers: zaks.anna, dcoughlin.
NoQ added a subscriber: cfe-commits.
Herald added a subscriber: mgorny.
When an ObjC property is declared as `(copy)`, and the type of the property is
mutable (eg. `NSMutableSomething`), the autosynthesized code for the