Skip to content

Commit 44c0719

Browse files
committed
Silence MSVC warnings; NFC
After the changes to DynamicRecursiveASTVisitor, we started getting several warnings from MSVC like: warning C4661: 'bool clang::DynamicRecursiveASTVisitorBase<false>::WalkUpFromNamedDecl(clang::NamedDecl *)': no suitable definition provided for explicit template instantiation request These changes silence the warnings by providing a definition for those functions.
1 parent e5b2be3 commit 44c0719

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

clang/include/clang/AST/DynamicRecursiveASTVisitor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ template <bool IsConst> class DynamicRecursiveASTVisitorBase {
254254
virtual bool Traverse##CLASS##Decl(MaybeConst<CLASS##Decl> *D);
255255
#include "clang/AST/DeclNodes.inc"
256256

257+
#define ABSTRACT_DECL(DECL)
257258
#define DECL(CLASS, BASE) \
258259
bool WalkUpFrom##CLASS##Decl(MaybeConst<CLASS##Decl> *D); \
259260
virtual bool Visit##CLASS##Decl(MaybeConst<CLASS##Decl> *D) { return true; }
@@ -275,6 +276,7 @@ template <bool IsConst> class DynamicRecursiveASTVisitorBase {
275276
virtual bool Traverse##CLASS##Type(MaybeConst<CLASS##Type> *T);
276277
#include "clang/AST/TypeNodes.inc"
277278

279+
#define ABSTRACT_TYPE(CLASS, BASE)
278280
#define TYPE(CLASS, BASE) \
279281
bool WalkUpFrom##CLASS##Type(MaybeConst<CLASS##Type> *T); \
280282
virtual bool Visit##CLASS##Type(MaybeConst<CLASS##Type> *T) { return true; }

clang/lib/AST/DynamicRecursiveASTVisitor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ template <bool Const> struct Impl : RecursiveASTVisitor<Impl<Const>> {
221221
return Visitor.Traverse##CLASS##Decl(D); \
222222
}
223223
#include "clang/AST/DeclNodes.inc"
224-
224+
#define ABSTRACT_DECL(DECL)
225225
#define DECL(CLASS, BASE) \
226226
bool Visit##CLASS##Decl(CLASS##Decl *D) { \
227227
return Visitor.Visit##CLASS##Decl(D); \
@@ -246,6 +246,7 @@ template <bool Const> struct Impl : RecursiveASTVisitor<Impl<Const>> {
246246
}
247247
#include "clang/AST/TypeNodes.inc"
248248

249+
#define ABSTRACT_TYPE(CLASS, BASE)
249250
#define TYPE(CLASS, BASE) \
250251
bool Visit##CLASS##Type(CLASS##Type *T) { \
251252
return Visitor.Visit##CLASS##Type(T); \

0 commit comments

Comments
 (0)