Index: clang-tidy/performance/InefficientVectorOperationCheck.cpp =================================================================== --- clang-tidy/performance/InefficientVectorOperationCheck.cpp +++ clang-tidy/performance/InefficientVectorOperationCheck.cpp @@ -73,8 +73,13 @@ } void InefficientVectorOperationCheck::registerMatchers(MatchFinder *Finder) { - const auto VectorDecl = cxxRecordDecl(hasAnyName(SmallVector( - VectorLikeClasses.begin(), VectorLikeClasses.end()))); + const auto VectorDecl = classTemplateSpecializationDecl( + hasAnyName(SmallVector(VectorLikeClasses.begin(), + VectorLikeClasses.end())), + // Exclude std::vector: STL provides a specilaization of std::vector + // for the type "bool", which may be optimized for space efficiency (e.g. + // each element occupies a single bit instead of sizeof(bool) bytes). + unless(hasTemplateArgument(0, refersToType(booleanType())))); const auto VectorDefaultConstructorCall = cxxConstructExpr( hasType(VectorDecl), hasDeclaration(cxxConstructorDecl(isDefaultConstructor()))); Index: test/clang-tidy/performance-inefficient-vector-operation.cpp =================================================================== --- test/clang-tidy/performance-inefficient-vector-operation.cpp +++ test/clang-tidy/performance-inefficient-vector-operation.cpp @@ -274,4 +274,12 @@ z12.push_back(e); } } + { + std::vector z14; + // std::vector will be ignored as STL provides a possibly + // space-efficient specilaization of std::vector for the type "bool". + for (int i = 0; i < 10; ++i) { + z14.push_back(true); + } + } }