This revision was automatically updated to reflect the committed changes.
Closed by commit rL268352: [clang-tidy] ProTypeMemberInitCheck - check that 
field decls do not have in… (authored by flx).

Changed prior to commit:
  http://reviews.llvm.org/D18300?vs=51123&id=55934#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18300

Files:
  
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
  
clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp

Index: 
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
===================================================================
--- 
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
+++ 
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
@@ -31,6 +31,8 @@
                          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))
Index: 
clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
===================================================================
--- 
clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
+++ 
clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
@@ -85,6 +85,14 @@
   int I;
 };
 
+struct A {};
+template <class> class AA;
+template <class T> class NegativeTemplateConstructor {
+  NegativeTemplateConstructor(const AA<T> &, A) {}
+  bool Bool{false};
+  // CHECK-FIXES: bool Bool{false};
+};
+
 #define UNINITIALIZED_FIELD_IN_MACRO_BODY(FIELD) \
   struct UninitializedField##FIELD {             \
     UninitializedField##FIELD() {}               \


Index: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
@@ -31,6 +31,8 @@
                          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))
Index: clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
===================================================================
--- clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
+++ clang-tools-extra/trunk/test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp
@@ -85,6 +85,14 @@
   int I;
 };
 
+struct A {};
+template <class> class AA;
+template <class T> class NegativeTemplateConstructor {
+  NegativeTemplateConstructor(const AA<T> &, A) {}
+  bool Bool{false};
+  // CHECK-FIXES: bool Bool{false};
+};
+
 #define UNINITIALIZED_FIELD_IN_MACRO_BODY(FIELD) \
   struct UninitializedField##FIELD {             \
     UninitializedField##FIELD() {}               \
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to