Fix for ASTMatchFinder to visit a functions parameter declarations.
llvm-svn: 160947
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index 91095eb..8768baf 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -859,6 +859,12 @@
"}", Reference));
}
+TEST(Matcher, FindsVarDeclInFuncitonParameter) {
+ EXPECT_TRUE(matches(
+ "void f(int i) {}",
+ variable(hasName("i"))));
+}
+
TEST(Matcher, CalledVariable) {
StatementMatcher CallOnVariableY = expression(
memberCall(on(declarationReference(to(variable(hasName("y")))))));