[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-14 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas added a comment. In D75749#1912338 , @njames93 wrote: > LGTM > > However, how does this handle cases when the type is written as `char`. They > can be signed/unsigned based on what platform is being targeted. But on a > platform where `char` is

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-14 Thread Tamás Zolnai via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG04410c565aa0: [clang-tidy] extend bugprone-signed-char-misuse check. (authored by ztamas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75749/new/

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-09 Thread Nathan James via Phabricator via cfe-commits
njames93 accepted this revision. njames93 added a comment. This revision is now accepted and ready to land. LGTM However, how does this handle cases when the type is written as `char`. They can be signed/unsigned based on what platform is being targeted. But on a platform where `char` is

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-07 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas updated this revision to Diff 248917. ztamas added a comment. Update code based on reviewer comments. - Update docs: comparison -> equality/inequality comparison. - Use hasAnyOperatorName - Plus fix a typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-07 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp:97 + const auto CompareOperator = + expr(binaryOperator(anyOf(hasOperatorName("=="), hasOperatorName("!=")), +

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-07 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas updated this revision to Diff 248912. ztamas added a comment. Use quotes in warning message. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75749/new/ https://reviews.llvm.org/D75749 Files:

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-07 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas marked an inline comment as done. ztamas added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp:97 + const auto CompareOperator = + expr(binaryOperator(anyOf(hasOperatorName("=="), hasOperatorName("!=")), +

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-07 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas updated this revision to Diff 248909. ztamas added a comment. One more unneeded allOf and clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75749/new/ https://reviews.llvm.org/D75749 Files:

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-07 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas updated this revision to Diff 248907. ztamas added a comment. Fix pre-merge check error Plus remove unneeded "no warning" comments and add a missing quote mark in docs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75749/new/

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-07 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas updated this revision to Diff 248908. ztamas added a comment. Changed code based on reviewer comments. - Removed unneeded allOf() - Remove unneeded ';' - Added new line at the end of the file - Moved variable declarations inside if() Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-07 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp:74 +void SignedCharMisuseCheck::registerMatchers(MatchFinder *Finder) { + const auto IntegerType = qualType(allOf(isInteger(), unless(isAnyCharacter()), +

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-06 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas added a comment. In the LibreOffice codebase, I found 8 catches: https://gist.github.com/tzolnai/2b22492c0cf79f5dba577f6a878657e3 All catches seem valid to me. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75749/new/

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-06 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas created this revision. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. ztamas added a reviewer: aaron.ballman. ztamas added a comment. I run the check on LLVM code and found only one catch of suspicious comparison: clang-tidy -p=/home/zolnai/clang/build

[PATCH] D75749: [clang-tidy] extend bugprone-signed-char-misuse check.

2020-03-06 Thread Tamás Zolnai via Phabricator via cfe-commits
ztamas added a comment. I run the check on LLVM code and found only one catch of suspicious comparison: clang-tidy -p=/home/zolnai/clang/build /home/zolnai/clang/llvm-project/clang/lib/Lex/Lexer.cpp /home/zolnai/clang/llvm-project/clang/lib/Lex/Lexer.cpp:1293:39: warning: comparison