It's fine to use sizeof on std::bitset<>, since it doesn't have any external
storage, everything's inside.
llvm-svn: 247489
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"),
size_t size() const;
};
+// std::bitset<> is not a container. sizeof() is reasonable for it.
+template <size_t N>
+struct bitset {
+ size_t size() const;
+};
+
class fake_container1 {
size_t size() const; // non-public
};
std::fake_container1 f1;
std::fake_container2 f2;
+ std::bitset<7> bs;
a = sizeof(f1);
a = sizeof(f2);
+ a = sizeof(bs);
std::string arr[3];