1 //===- unittest/Tooling/RecursiveASTVisitorTests/IntegerLiteral.cpp -------===//
3 // 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
7 //===----------------------------------------------------------------------===//
9 #include "TestVisitor.h"
11 using namespace clang
;
15 // Check to ensure that implicit default argument expressions are visited.
16 class IntegerLiteralVisitor
17 : public ExpectedLocationVisitor
<IntegerLiteralVisitor
> {
19 bool VisitIntegerLiteral(const IntegerLiteral
*IL
) {
20 Match("literal", IL
->getLocation());
25 TEST(RecursiveASTVisitor
, DefaultArgumentsAreVisited
) {
26 IntegerLiteralVisitor Visitor
;
27 Visitor
.ExpectMatch("literal", 1, 15, 2);
28 EXPECT_TRUE(Visitor
.runOver("int f(int i = 1);\n"
29 "static int k = f();\n"));
32 } // end anonymous namespace