[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 1 08:06:12 PST 2020
aaron.ballman added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp:47
+ CheckFactories.registerCheck<PreferMemberInitializerCheck>(
+ "cppcoreguidelines-prefer-member-initializer");
CheckFactories.registerCheck<modernize::AvoidCArraysCheck>(
----------------
Please keep this list sorted alphabetically.
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp:43
+static bool isLiteral(const Expr *E) {
+ return isa<StringLiteral>(E) ||
+ isa<CharacterLiteral>(E) ||
----------------
What about other kinds of literals like user-defined literals, or literal class types? Should this be using `E->getType()->isLiteralType()`?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71199/new/
https://reviews.llvm.org/D71199
More information about the cfe-commits
mailing list