[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL307791: [clang-tidy] Add new modernize use unary assert check (authored by xazax). Changed prior to commit: https://reviews.llvm.org/D35257?vs=106195&id=106197#toc Repository: rL LLVM https://review

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D35257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: test/clang-tidy/modernize-unary-static-assert.cpp:16 + // CHECK-FIXES: {{^}} FOO{{$}} + static_assert(sizeof(a) <= 17, MSG); + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use unary 'static_assert' when aaron.ballma

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106195. barancsuk marked 4 inline comments as done. barancsuk added a comment. - No longer warn when the message is from a macro expansion https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyMod

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/UnaryStaticAssertCheck.cpp:32 + + if (!AssertMessage || AssertMessage->getLength()) +return; barancsuk wrote: > aaron.ballman wrote: > > I think this should be `!AssertMessage->getLength()

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/modernize/UnaryStaticAssertCheck.cpp:32 + + if (!AssertMessage || AssertMessage->getLength()) +return; aaron.ballman wrote: > I think this should be `!AssertMessage->getLength()` It works correctly with

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106148. barancsuk marked 2 inline comments as done. barancsuk added a comment. - Further reviews addressed https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/U

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/UnaryStaticAssertCheck.cpp:32 + + if (!AssertMessage || AssertMessage->getLength()) +return; I think this should be `!AssertMessage->getLength()` Comment at: test/clang-

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106026. barancsuk added a comment. - Missed some fixes last time https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UnaryStaticAssertCheck.cpp clang-tidy/mod

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106025. barancsuk marked 10 inline comments as done. barancsuk added a comment. - Address review comments https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/Un

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/UnaryStaticAssertCheck.cpp:28 +void UnaryStaticAssertCheck::check(const MatchFinder::MatchResult &Result) { + + const auto *MatchedDecl = Can remove the empty line. Comment

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106021. barancsuk added a comment. - Do not rewrite macro expansions https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UnaryStaticAssertCheck.cpp clang-tidy

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please mention this check in docs/ReleaseNotes.rst (in alphabetical order). Comment at: clang-tidy/modernize/UnaryStaticAssertCheck.cpp:28 +void UnaryStaticAssertCheck::check(const MatchFinder::MatchResult &Result) { + + const auto *MatchedDecl

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk created this revision. barancsuk added a project: clang-tools-extra. Herald added subscribers: xazax.hun, JDevlieghere, mgorny. The check finds `static_assert` declarations with empty messages, and replaces them with an unary `static_assert` declaration. The check is only applicable fo