summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
diff options
context:
space:
mode:
authorFelix Berger <flx@google.com>2016-05-03 01:41:19 +0000
committerFelix Berger <flx@google.com>2016-05-03 01:41:19 +0000
commitb6947a58473f85cdee708d37649fed793ce49025 (patch)
tree413d30681044e969c1f368fce948a1f156284d88 /clang-tools-extra/clang-tidy
parent92fbd8df15b5ba7f624c1f24e785c71ae9e71ef3 (diff)
downloadbcm5719-llvm-b6947a58473f85cdee708d37649fed793ce49025.tar.gz
bcm5719-llvm-b6947a58473f85cdee708d37649fed793ce49025.zip
[clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer.
Reviewers: alexfh, JVApen, aaron.ballman Subscribers: flx, aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D18300 llvm-svn: 268352
Diffstat (limited to 'clang-tools-extra/clang-tidy')
-rw-r--r--clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
index eabadd89a9b..9ba8bd902d7 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
@@ -31,6 +31,8 @@ void fieldsRequiringInit(const RecordDecl::field_range &Fields,
ASTContext &Context,
SmallPtrSetImpl<const FieldDecl *> &FieldsToInit) {
for (const FieldDecl *F : Fields) {
+ if (F->hasInClassInitializer())
+ continue;
QualType Type = F->getType();
if (!F->hasInClassInitializer() &&
type_traits::isTriviallyDefaultConstructible(Type, Context))
OpenPOWER on IntegriCloud