misc-static-assert now recognizes __builtin_expect based assert macros.
I also added __builtin_expect to the white list of misc-assert-side-effect.
Paths
| Differential D9959
[clang-tidy] Fix for llvm.org/PR23355 ClosedPublic Authored by eszasip on May 24 2015, 6:33 AM.
Details
Summary misc-static-assert now recognizes __builtin_expect based assert macros. I also added __builtin_expect to the white list of misc-assert-side-effect.
Diff Detail Event Timelineeszasip updated this object. alexfh edited edge metadata. Comment ActionsThanks! Looks good with one nit.
This revision is now accepted and ready to land.May 26 2015, 7:35 AM Comment Actions Committed in r238548.
Revision Contents
Diff 26379 clang-tidy/misc/AssertSideEffectCheck.cpp
clang-tidy/misc/StaticAssertCheck.cpp
test/clang-tidy/misc-assert-side-effect.cpp
test/clang-tidy/misc-static-assert.cpp
|
There's no need to use getAsString(), as you're only checking whether it's a specific unqualified name. I'd try to use the more effective version: getName(). Something along the lines of: