[analyzer] Fix NSErrorChecker false positives on constructors.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 6 Apr 2020 17:27:40 +0000 (20:27 +0300)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 6 Apr 2020 17:33:38 +0000 (20:33 +0300)
commit9b1e4a8218b7fcb8900d0382704fdb4e38b52eb0
treee3264a964922b8f1268dd2cabdecadf49634640d
parent2ddd3325c4d7ab47b62a9fe72a0d1c1d8ec7f9d7
[analyzer] Fix NSErrorChecker false positives on constructors.

Constructors and delete operators cannot return a boolean value.
Therefore they cannot possibly follow the NS/CFError-related coding
conventions.

Patch by Valeriy Savchenko!

Differential Revision: https://reviews.llvm.org/D77551
clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
clang/test/Analysis/SpecialFunctionsCFError.cpp [new file with mode: 0644]