}
bool MatchASTVisitor::TraverseTypeLoc(TypeLoc TypeLoc) {
+ match(TypeLoc.getType());
return RecursiveASTVisitor<MatchASTVisitor>::
- TraverseType(TypeLoc.getType());
+ TraverseTypeLoc(TypeLoc);
}
class MatchASTConsumer : public ASTConsumer {
"}", 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")))))));