aaron.ballman added inline comments.
================ Comment at: clang-tidy/modernize/UseDefaultMemberInitCheck.cpp:165 - Finder->addMatcher( - cxxConstructorDecl( - isDefaultConstructor(), unless(isInstantiated()), - forEachConstructorInitializer( - cxxCtorInitializer( - forField(unless(anyOf(isBitField(), - hasInClassInitializer(anything()), - hasParent(recordDecl(isUnion()))))), - isWritten(), withInitializer(ignoringImplicit(Init))) - .bind("default"))), - this); + if (getLangOpts().CPlusPlus2a) + Finder->addMatcher( ---------------- 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. ================ Comment at: test/clang-tidy/modernize-use-default-member-init-bitfield.cpp:1 +// RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- -- -std=c++2a + ---------------- I'd like to see a test where C++2a is not enabled to ensure that the fix is not suggested in that case. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D42413 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits