Index: clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp +++ clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp @@ -402,6 +402,8 @@ // Gather all fields (direct and indirect) that need to be initialized. SmallPtrSet FieldsToInit; forEachField(ClassDecl, ClassDecl.fields(), [&](const FieldDecl *F) { + if (IgnoreArrays && F->getType()->isArrayType()) + return; if (!F->hasInClassInitializer() && utils::type_traits::isTriviallyDefaultConstructible(F->getType(), Context) && Index: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init.ignorearrays.cpp =================================================================== --- /dev/null +++ clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init.ignorearrays.cpp @@ -0,0 +1,11 @@ +// RUN: %check_clang_tidy %s \ +// RUN: cppcoreguidelines-pro-type-member-init %t \ +// RUN: -config="{CheckOptions: \ +// RUN: [{key: cppcoreguidelines-pro-type-member-init.IgnoreArrays, value: true} ]}" + +struct HasArrayMember { + HasArrayMember() {} + // CHECK-MESSAGES: warning: constructor does not initialize these fields: Number + int Array[4]; + int Number; +};