From 541de378cedc703fcb5bde480141589ba9ece377 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Fri, 11 Sep 2015 22:54:44 +0000 Subject: [clang-tidy] misc-sizeof-container: whitelist std::bitset<>. It's fine to use sizeof on std::bitset<>, since it doesn't have any external storage, everything's inside. llvm-svn: 247489 --- clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp') diff --git a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp index 44753b93382..2a5d91af385 100644 --- a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp @@ -36,6 +36,7 @@ void SizeofContainerCheck::registerMatchers(MatchFinder *Finder) { expr(unless(isInTemplateInstantiation()), expr(sizeOfExpr(has(expr(hasType(hasCanonicalType(hasDeclaration( recordDecl(matchesName("^(::std::|::string)"), + unless(hasName("::std::bitset")), hasMethod(methodDecl(hasName("size"), isPublic(), isConst())))))))))) .bind("sizeof"), -- cgit v1.2.3