AST Matchers tests: test that member() matches member allocation functions:

declare size_t in system-independent way.

llvm-svn: 162158
This commit is contained in:
Dmitri Gribenko 2012-08-18 00:41:04 +00:00
parent a4309c941c
commit edee47891c

View File

@ -2014,14 +2014,14 @@ TEST(Member, MatchesInMemberFunctionCall) {
}
TEST(Member, MatchesMemberAllocationFunction) {
EXPECT_TRUE(matches("namespace std { typedef unsigned long size_t; }"
EXPECT_TRUE(matches("namespace std { typedef typeof(sizeof(int)) 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; }"
EXPECT_TRUE(matches("namespace std { typedef typeof(sizeof(int)) size_t; }"
"class X { void operator delete[](void*, std::size_t); };",
method(ofClass(hasName("X")))));
}