diff options
author | Manuel Klimek <klimek@google.com> | 2012-10-23 10:40:50 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2012-10-23 10:40:50 +0000 |
commit | 70b9db9879c1cb8b8ca7d6c9809e35361cab83dc (patch) | |
tree | 88c5173b9998e2af5f7af6be73086bd0a2442598 /unittests/ASTMatchers/ASTMatchersTest.cpp | |
parent | 129dd54349510973c853579b34cf31fa8faad5f8 (diff) |
Implements the thisExpr matcher.
Patch by Gabor Horvath.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index 5c97f3abac..a97e90d74c 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -1333,6 +1333,13 @@ TEST(Matcher, ConstructorArgumentCount) { Constructor1Arg)); } +TEST(Matcher,ThisExpr) { + EXPECT_TRUE( + matches("struct X { int a; int f () { return a; } };", thisExpr())); + EXPECT_TRUE( + notMatches("struct X { int f () { int a; return a; } };", thisExpr())); +} + TEST(Matcher, BindTemporaryExpression) { StatementMatcher TempExpression = bindTemporaryExpr(); |