|
13 | 13 |
|
14 | 14 | #include "clang/AST/ASTConsumer.h"
|
15 | 15 | #include "clang/AST/ASTMutationListener.h"
|
16 |
| -#include "clang/AST/RecursiveASTVisitor.h" |
| 16 | +#include "clang/AST/DynamicRecursiveASTVisitor.h" |
17 | 17 | #include "clang/Lex/HeaderSearch.h"
|
18 | 18 | #include "clang/Lex/Preprocessor.h"
|
19 | 19 | #include "clang/Sema/ParsedAttr.h"
|
@@ -1422,14 +1422,14 @@ bool ExposureChecker::checkExposure(const CXXRecordDecl *RD, bool Diag) {
|
1422 | 1422 | return IsExposure;
|
1423 | 1423 | }
|
1424 | 1424 |
|
1425 |
| -template <typename CallbackTy> |
1426 |
| -class ReferenceTULocalChecker |
1427 |
| - : public clang::RecursiveASTVisitor<ReferenceTULocalChecker<CallbackTy>> { |
| 1425 | +class ReferenceTULocalChecker : public DynamicRecursiveASTVisitor { |
1428 | 1426 | public:
|
| 1427 | + using CallbackTy = std::function<void(DeclRefExpr *, ValueDecl *)>; |
| 1428 | + |
1429 | 1429 | ReferenceTULocalChecker(ExposureChecker &C, CallbackTy &&Callback)
|
1430 | 1430 | : Checker(C), Callback(std::move(Callback)) {}
|
1431 | 1431 |
|
1432 |
| - bool VisitDeclRefExpr(DeclRefExpr *DRE) { |
| 1432 | + bool VisitDeclRefExpr(DeclRefExpr *DRE) override { |
1433 | 1433 | ValueDecl *Referenced = DRE->getDecl();
|
1434 | 1434 | if (!Referenced)
|
1435 | 1435 | return true;
|
@@ -1468,10 +1468,6 @@ class ReferenceTULocalChecker
|
1468 | 1468 | CallbackTy Callback;
|
1469 | 1469 | };
|
1470 | 1470 |
|
1471 |
| -template <typename CallbackTy> |
1472 |
| -ReferenceTULocalChecker(ExposureChecker &, CallbackTy &&) |
1473 |
| - -> ReferenceTULocalChecker<CallbackTy>; |
1474 |
| - |
1475 | 1471 | bool ExposureChecker::checkExposure(const Stmt *S, bool Diag) {
|
1476 | 1472 | if (!S)
|
1477 | 1473 | return false;
|
|
0 commit comments