C++2a allows bitfields to have default member initializers.
Add support for this to clang-tidy's modernize-use-default-member-init check.
Details
Details
- Reviewers
aaron.ballman alexfh - Commits
- rGe034e5eefe84: [clang-tidy] Handle bitfields in modernize-use-default-member-init if using…
rCTE323208: [clang-tidy] Handle bitfields in modernize-use-default-member-init if using…
rL323208: [clang-tidy] Handle bitfields in modernize-use-default-member-init if using…
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tidy/modernize/UseDefaultMemberInitCheck.cpp | ||
---|---|---|
165 ↗ | (On Diff #131032) | I wonder if we could add a nothing() matcher (sibling to the anything() matcher) so that this could be rewritten as: unless(anyOf(getLangOpts().CPlusPlus2a ? nothing() : isBitField())) The duplication here adds complexity if we decide to change the matchers in the future. |
test/clang-tidy/modernize-use-default-member-init-bitfield.cpp | ||
1 ↗ | (On Diff #131032) | I'd like to see a test where C++2a is not enabled to ensure that the fix is not suggested in that case. |
Comment Actions
Comment Actions
LGTM!
clang-tidy/modernize/UseDefaultMemberInitCheck.cpp | ||
---|---|---|
165 ↗ | (On Diff #131032) | Ah, good point! Nice, this is much more clean. |