summaryrefslogtreecommitdiffstats
path: root/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
diff options
context:
space:
mode:
authorCong Liu <congliu@google.com>2016-06-24 09:38:03 +0000
committerCong Liu <congliu@google.com>2016-06-24 09:38:03 +0000
commit85b4750b8d7cfecda65218124138d8254ffa3c46 (patch)
tree0e1d5d42174b639f97ffa10ea13357698bf0fd2e /unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
parent17a752beb9a8c15a8667569bae759590264bcc91 (diff)
IgnoringImplicit matcher.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersTraversalTest.cpp')
-rw-r--r--unittests/ASTMatchers/ASTMatchersTraversalTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
index cc5cf715a7..a3f616967d 100644
--- a/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
+++ b/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
@@ -1088,6 +1088,16 @@ TEST(HasImplicitDestinationType, DoesNotMatchIncorrectly) {
unless(anything())))));
}
+TEST(IgnoringImplicit, MatchesImplicit) {
+ EXPECT_TRUE(matches("class C {}; C a = C();",
+ varDecl(has(ignoringImplicit(cxxConstructExpr())))));
+}
+
+TEST(IgnoringImplicit, DoesNotMatchIncorrectly) {
+ EXPECT_TRUE(
+ notMatches("class C {}; C a = C();", varDecl(has(cxxConstructExpr()))));
+}
+
TEST(IgnoringImpCasts, MatchesImpCasts) {
// This test checks that ignoringImpCasts matches when implicit casts are
// present and its inner matcher alone does not match.