[PATCH] D23427: [Clang-tidy] Comparison Misuse

2017-02-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun abandoned this revision. xazax.hun added a comment. For the first case ToT clang compiler gives a warning (-Wstring-compare), for the second case, it generates a compiler error (error: ordered comparison between pointer and zero). Note that, older versions of clang did not even give a

Re: [PATCH] D23427: [Clang-tidy] Comparison Misuse

2016-08-16 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. Thank you for working on this check! We already have a frontend diagnostic for comparisons between string literals and pointers, so I'm not certain of the utility of adding a clang-tidy check for that case (see -Wstring-compare, aka, http://coliru.stacked-crooked

Re: [PATCH] D23427: [Clang-tidy] Comparison Misuse

2016-08-12 Thread Haojian Wu via cfe-commits
hokein added inline comments. Comment at: clang-tidy/misc/ComparisonMisuseCheck.cpp:31 @@ +30,3 @@ + unless(anyOf(hasOperatorName("=="), hasOperatorName("!="))), + hasEitherOperand(ignoringImpCasts(gnuNullExpr( + .bind("compareToNull"), -

Re: [PATCH] D23427: [Clang-tidy] Comparison Misuse

2016-08-11 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/misc/ComparisonMisuseCheck.cpp:21 @@ +20,3 @@ +void ComparisonMisuseCheck::registerMatchers(MatchFinder *Finder) { + + Finder->addMatcher( Please remove this line. Repository: rL LLVM https://revie

Re: [PATCH] D23427: [Clang-tidy] Comparison Misuse

2016-08-11 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko. Eugene.Zelenko added a comment. Please mention this check in docs/ReleaseNotes.rst (in alphabetical order). Please run Clang-format on newly added files. Test case is definitely needs it. Comment at: clang-tidy/misc/ComparisonM

[PATCH] D23427: [Clang-tidy] Comparison Misuse

2016-08-11 Thread Benedek Kiss via cfe-commits
falho created this revision. falho added reviewers: xazax.hun, o.gyorgy, alexfh, aaron.ballman, etienneb, hokein, Prazek. falho added a subscriber: cfe-commits. falho set the repository for this revision to rL LLVM. This checker warns for the misuse of comparison operators - char* is compared to