AST Matchers tests: test that member() matches member allocation functions.
llvm-svn: 162153
This commit is contained in:
parent
319e927ae1
commit
0696304a61
|
@ -2013,6 +2013,19 @@ TEST(Member, MatchesInMemberFunctionCall) {
|
|||
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; }",
|
||||
|
|
Loading…
Reference in New Issue