[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / clang / unittests / Tooling / RecursiveASTVisitorTests / CXXBoolLiteralExpr.cpp
blob4b0c4c31f2dd2e2d2a571f22a5af82128432c15b
1 //===- unittest/Tooling/RecursiveASTVisitorTests/CXXBoolLiteralExpr.cpp ---===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 #include "TestVisitor.h"
11 using namespace clang;
13 namespace {
15 class CXXBoolLiteralExprVisitor : public ExpectedLocationVisitor {
16 public:
17 bool VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *BE) override {
18 if (BE->getValue())
19 Match("true", BE->getLocation());
20 else
21 Match("false", BE->getLocation());
22 return true;
26 TEST(RecursiveASTVisitor, VisitsClassTemplateNonTypeParmDefaultArgument) {
27 CXXBoolLiteralExprVisitor Visitor;
28 Visitor.ExpectMatch("true", 2, 19);
29 EXPECT_TRUE(Visitor.runOver(
30 "template<bool B> class X;\n"
31 "template<bool B = true> class Y;\n"
32 "template<bool B> class Y {};\n"));
35 } // end anonymous namespace