| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | #include "TestVisitor.h" |
| 10 | |
| 11 | using namespace clang; |
| 12 | |
| 13 | namespace { |
| 14 | |
| 15 | class CXXBoolLiteralExprVisitor |
| 16 | : public ExpectedLocationVisitor<CXXBoolLiteralExprVisitor> { |
| 17 | public: |
| 18 | bool VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *BE) { |
| 19 | if (BE->getValue()) |
| 20 | Match("true", BE->getLocation()); |
| 21 | else |
| 22 | Match("false", BE->getLocation()); |
| 23 | return true; |
| 24 | } |
| 25 | }; |
| 26 | |
| 27 | TEST(RecursiveASTVisitor, VisitsClassTemplateNonTypeParmDefaultArgument) { |
| 28 | CXXBoolLiteralExprVisitor Visitor; |
| 29 | Visitor.ExpectMatch("true", 2, 19); |
| 30 | EXPECT_TRUE(Visitor.runOver( |
| 31 | "template<bool B> class X;\n" |
| 32 | "template<bool B = true> class Y;\n" |
| 33 | "template<bool B> class Y {};\n")); |
| 34 | } |
| 35 | |
| 36 | } |
| 37 | |