summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2020-01-10 19:39:57 +0000
committerStephen Kelly <steveire@gmail.com>2020-01-10 19:47:12 +0000
commit55d7b22277e1c5e710bac7d4d4dc09db3a22dad8 (patch)
tree6e3cde0272f383e87d8e7c1162a96e54222be691 /clang
parentba91dffafe4d348b469d8ae2b7b1cd00754f72f1 (diff)
downloadbcm5719-llvm-55d7b22277e1c5e710bac7d4d4dc09db3a22dad8.tar.gz
bcm5719-llvm-55d7b22277e1c5e710bac7d4d4dc09db3a22dad8.zip
[ASTMatchers] Make test more clear about what it is verifying
Diffstat (limited to 'clang')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
index 6ca54df0657..ee7b3bfd5b1 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
@@ -1639,9 +1639,12 @@ void foo()
EXPECT_TRUE(matches(VarDeclCode, varDecl(traverse(ast_type_traits::TK_AsIs,
has(implicitCastExpr())))));
- EXPECT_TRUE(notMatches(
+ EXPECT_TRUE(matches(
VarDeclCode,
- varDecl(has(traverse(ast_type_traits::TK_AsIs, floatLiteral())))));
+ traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
+ // The has() below strips away the ImplicitCastExpr before the
+ // traverse(AsIs) gets to process it.
+ varDecl(has(traverse(ast_type_traits::TK_AsIs, floatLiteral()))))));
EXPECT_TRUE(matches(
VarDeclCode,
OpenPOWER on IntegriCloud