memberExpression(member(hasName("first")))));
}
+TEST(Member, MatchesMemberAllocationFunction) {
+ EXPECT_TRUE(matches("namespace std { typedef unsigned long size_t; }"
+ "class X { void *operator new(std::size_t); };",
+ method(ofClass(hasName("X")))));
+
+ EXPECT_TRUE(matches("class X { void operator delete(void*); };",
+ method(ofClass(hasName("X")))));
+
+ EXPECT_TRUE(matches("namespace std { typedef unsigned long size_t; }"
+ "class X { void operator delete[](void*, std::size_t); };",
+ method(ofClass(hasName("X")))));
+}
+
TEST(HasObjectExpression, DoesNotMatchMember) {
EXPECT_TRUE(notMatches(
"class X {}; struct Z { X m; }; void f(Z z) { z.m; }",