Re: [PATCH] D24507: Add attribute for return values that shouldn't be cast to bool

2016-09-20 Thread Anton Urusov via cfe-commits
urusant added inline comments. Comment at: lib/StaticAnalyzer/Checkers/ReturnNonBoolChecker.cpp:50 @@ +49,3 @@ + if (!State->contains(SR)) return; + + ExplodedNode *N = C.generateErrorNode(C.getState()); I have just noticed that I didn't specify the style

Re: [PATCH] D24507: Add attribute for return values that shouldn't be cast to bool

2016-09-20 Thread Anton Urusov via cfe-commits
urusant updated this revision to Diff 71927. Repository: rL LLVM https://reviews.llvm.org/D24507 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/StaticAnalyzer/Checkers/Checkers.td lib/Sema/SemaChecking.cpp

Re: [PATCH] D24507: Add attribute for return values that shouldn't be cast to bool

2016-09-20 Thread Anton Urusov via cfe-commits
urusant updated this revision to Diff 71921. urusant added a comment. In https://reviews.llvm.org/D24507#546380, @aaron.ballman wrote: > We try to keep our tests segregated by functionality. e.g., tests relating to > the way the attribute is handled (what it appertains to, args, etc) should >

Re: [PATCH] D24507: Add attribute for return values that shouldn't be cast to bool

2016-09-19 Thread Anton Urusov via cfe-commits
urusant added a comment. Thank you for the feedback. > The patch is missing Sema tests for the attribute (that it only applies to > declarations you expect, accepts no args, etc). There is one test case for that in test/ReturnNonBoolTestCompileTime.cpp. I've added another one for attribute

Re: [PATCH] D24507: Add attribute for return values that shouldn't be cast to bool

2016-09-19 Thread Anton Urusov via cfe-commits
urusant updated this revision to Diff 71807. urusant added a comment. Made some changes based on the comments. Please refer to the replies below. Repository: rL LLVM https://reviews.llvm.org/D24507 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td

[PATCH] D24507: Add attribute for return values that shouldn't be cast to bool

2016-09-13 Thread Anton Urusov via cfe-commits
urusant created this revision. urusant added reviewers: zaks.anna, dcoughlin, jordan_rose, NoQ. urusant added subscribers: cfe-commits, daviddrysdale. urusant set the repository for this revision to rL LLVM. Herald added subscribers: mgorny, beanz. Hi, I am interested in feedback on a patch I