blob: b6a5a18e01765695a388eba21ab86c4edc8c4907 [file] [log] [blame]
David Zarzyckid488daa2018-04-19 18:19:02 +00001//===- unittest/Tooling/RecursiveASTVisitorTests/ParenExpr.cpp ------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "TestVisitor.h"
11
12using namespace clang;
13
14namespace {
15
16class ParenExprVisitor : public ExpectedLocationVisitor<ParenExprVisitor> {
17public:
18 bool VisitParenExpr(ParenExpr *Parens) {
19 Match("", Parens->getExprLoc());
20 return true;
21 }
22};
23
24TEST(RecursiveASTVisitor, VisitsParensDuringDataRecursion) {
25 ParenExprVisitor Visitor;
26 Visitor.ExpectMatch("", 1, 9);
27 EXPECT_TRUE(Visitor.runOver("int k = (4) + 9;\n"));
28}
29
30} // end anonymous namespace