aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaModule.cpp')
-rw-r--r--clang/lib/Sema/SemaModule.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index 98ebd70..b137549 100644
--- a/clang/lib/Sema/SemaModule.cpp
+++ b/clang/lib/Sema/SemaModule.cpp
@@ -13,7 +13,7 @@
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTMutationListener.h"
-#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/DynamicRecursiveASTVisitor.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/ParsedAttr.h"
@@ -1422,14 +1422,14 @@ bool ExposureChecker::checkExposure(const CXXRecordDecl *RD, bool Diag) {
return IsExposure;
}
-template <typename CallbackTy>
-class ReferenceTULocalChecker
- : public clang::RecursiveASTVisitor<ReferenceTULocalChecker<CallbackTy>> {
+class ReferenceTULocalChecker : public DynamicRecursiveASTVisitor {
public:
+ using CallbackTy = std::function<void(DeclRefExpr *, ValueDecl *)>;
+
ReferenceTULocalChecker(ExposureChecker &C, CallbackTy &&Callback)
: Checker(C), Callback(std::move(Callback)) {}
- bool VisitDeclRefExpr(DeclRefExpr *DRE) {
+ bool VisitDeclRefExpr(DeclRefExpr *DRE) override {
ValueDecl *Referenced = DRE->getDecl();
if (!Referenced)
return true;
@@ -1468,10 +1468,6 @@ public:
CallbackTy Callback;
};
-template <typename CallbackTy>
-ReferenceTULocalChecker(ExposureChecker &, CallbackTy &&)
- -> ReferenceTULocalChecker<CallbackTy>;
-
bool ExposureChecker::checkExposure(const Stmt *S, bool Diag) {
if (!S)
return false;