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
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
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
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
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()
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
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
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-
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
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
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
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
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
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
14 matches
Mail list logo