blob: c316f98f40ce0f47964d9b5a259b56c6c5cf6097 [file] [log] [blame]
David Zarzyckid488daa2018-04-19 18:19:02 +00001//===- unittest/Tooling/RecursiveASTVisitorTests/ParenExpr.cpp ------------===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
David Zarzyckid488daa2018-04-19 18:19:02 +00006//
7//===----------------------------------------------------------------------===//
8
9#include "TestVisitor.h"
10
11using namespace clang;
12
13namespace {
14
15class ParenExprVisitor : public ExpectedLocationVisitor<ParenExprVisitor> {
16public:
17 bool VisitParenExpr(ParenExpr *Parens) {
18 Match("", Parens->getExprLoc());
19 return true;
20 }
21};
22
23TEST(RecursiveASTVisitor, VisitsParensDuringDataRecursion) {
24 ParenExprVisitor Visitor;
25 Visitor.ExpectMatch("", 1, 9);
26 EXPECT_TRUE(Visitor.runOver("int k = (4) + 9;\n"));
27}
28
29} // end anonymous namespace