diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-09-11 22:54:44 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-09-11 22:54:44 +0000 |
commit | 541de378cedc703fcb5bde480141589ba9ece377 (patch) | |
tree | 6b6e55e1e3b89c28f26bfe066fbfa6623e4b3738 /clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp | |
parent | c8a7eb5939e21657f55ba7a7935641e71512ee9e (diff) | |
download | bcm5719-llvm-541de378cedc703fcb5bde480141589ba9ece377.tar.gz bcm5719-llvm-541de378cedc703fcb5bde480141589ba9ece377.zip |
[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
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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"), |