summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
diff options
context:
space:
mode:
authorMalcolm Parsons <malcolm.parsons@gmail.com>2018-01-23 15:32:42 +0000
committerMalcolm Parsons <malcolm.parsons@gmail.com>2018-01-23 15:32:42 +0000
commite034e5eefe84665fdcd53ef6df521ddc2e3ecca3 (patch)
tree7999a9d4ad09390b7550ea3c1c4b9ac2d2ff8c39 /clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
parent9b4a097f94065fdcdb7aab7ce42502f2ca182600 (diff)
downloadbcm5719-llvm-e034e5eefe84665fdcd53ef6df521ddc2e3ecca3.tar.gz
bcm5719-llvm-e034e5eefe84665fdcd53ef6df521ddc2e3ecca3.zip
[clang-tidy] Handle bitfields in modernize-use-default-member-init if using C++2a
Summary: C++2a allows bitfields to have default member initializers. Add support for this to clang-tidy's modernize-use-default-member-init check. Reviewers: aaron.ballman, alexfh Reviewed By: aaron.ballman Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D42413 llvm-svn: 323208
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
index b07f730380e..c14c6853b9d 100644
--- a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
@@ -167,7 +167,9 @@ void UseDefaultMemberInitCheck::registerMatchers(MatchFinder *Finder) {
isDefaultConstructor(), unless(isInstantiated()),
forEachConstructorInitializer(
cxxCtorInitializer(
- forField(unless(anyOf(isBitField(),
+ forField(unless(anyOf(getLangOpts().CPlusPlus2a
+ ? unless(anything())
+ : isBitField(),
hasInClassInitializer(anything()),
hasParent(recordDecl(isUnion()))))),
isWritten(), withInitializer(ignoringImplicit(Init)))
OpenPOWER on IntegriCloud