Prazek closed this revision.
Prazek added a comment.
gg for your first check :)
http://reviews.llvm.org/D18745
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.
Looks good!
http://reviews.llvm.org/D18745
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo
staronj added inline comments.
Comment at: clang-tidy/modernize/UseBoolLiteralsCheck.cpp:56
@@ +55,3 @@
+ "converting integer literal to "
+ "bool%select{| inside a macro}0, use bool literal instead");
+
alexfh wrote:
> Can you
staronj updated this revision to Diff 56395.
staronj marked 3 inline comments as done.
http://reviews.llvm.org/D18745
Files:
clang-tidy/modernize/CMakeLists.txt
clang-tidy/modernize/ModernizeTidyModule.cpp
clang-tidy/modernize/UseBoolLiteralsCheck.cpp
clang-tidy/modernize/UseBoolLiteralsC
alexfh requested changes to this revision.
This revision now requires changes to proceed.
Comment at: clang-tidy/modernize/UseBoolLiteralsCheck.cpp:30
@@ +29,3 @@
+
+ Finder->addMatcher(implicitCastExpr(hasIntegerLiteralCastToBool,
+ unless(ha
staronj marked 5 inline comments as done.
staronj added a comment.
http://reviews.llvm.org/D18745
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
staronj updated the summary for this revision.
staronj updated this revision to Diff 53984.
staronj added a comment.
Check now finds implicit and explicit conversions from integer literal to bool.
http://reviews.llvm.org/D18745
Files:
clang-tidy/modernize/CMakeLists.txt
clang-tidy/modernize
alexfh requested changes to this revision.
This revision now requires changes to proceed.
Comment at: clang-tidy/modernize/UseBoolLiteralsCheck.cpp:39
@@ +38,3 @@
+
+ return LiteralSource.size() >= 1 && isDigit(LiteralSource.front());
+}
Use `!x.empty()` instead
staronj updated this revision to Diff 52843.
staronj added a comment.
1. Adds newline at the end of modernize-use-bool-literals.rst file.
2. Change names in check test for better readability.
3. Adds some new test cases.
http://reviews.llvm.org/D18745
Files:
clang-tidy/modernize/CMakeLists.tx
mnbvmar added a comment.
You could also think whether char literals should be converted to true/false,
too. Apart from this (and other people's doubts), everything's fine.
http://reviews.llvm.org/D18745
___
cfe-commits mailing list
cfe-commits@list
krystyna added a comment.
lgtm
http://reviews.llvm.org/D18745
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Eugene.Zelenko added a comment.
In http://reviews.llvm.org/D18745#391210, @Prazek wrote:
> In http://reviews.llvm.org/D18745#390739, @Eugene.Zelenko wrote:
>
> > Isn't readability-implicit-bool-cast¶ should catch such issues? If not, I
> > think will be good idea to improve that check instead of
LegalizeAdulthood added a subscriber: LegalizeAdulthood.
Comment at: docs/clang-tidy/checks/modernize-use-bool-literals.rst:17
@@ +16,1 @@
+ std::ios_base::sync_with_stdio(false);
\ No newline at end of file
Please ensure the file ends with a newline.
=
Prazek added a comment.
So the testing on llvm shows mostly one case - using DEBUG macro like this:
/home/prazek/llvm/lib/Support/APInt.cpp:1656:9: warning: implicitly converting
integer literal to bool inside macro, use bool literal instead
[modernize-use-bool-literals]
DEBUG(dbgs() << " "
staronj retitled this revision from "[clang-tidy] Adds misc-use-bool-literals
check." to "[clang-tidy] Adds modernize-use-bool-literals check.".
staronj updated this revision to Diff 52739.
staronj added a comment.
1. Name changed from misc-use-bool-literals to modernize-use-bool-literals.
2. Cod
15 matches
Mail list logo