Skip to content

Commit

Permalink
Silence MSVC warnings; NFC
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AaronBallman committed Jan 30, 2025
1 parent e5b2be3 commit 44c0719
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions clang/include/clang/AST/DynamicRecursiveASTVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ template <bool IsConst> class DynamicRecursiveASTVisitorBase {
virtual bool Traverse##CLASS##Decl(MaybeConst<CLASS##Decl> *D);
#include "clang/AST/DeclNodes.inc"

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

#define ABSTRACT_TYPE(CLASS, BASE)
#define TYPE(CLASS, BASE) \
bool WalkUpFrom##CLASS##Type(MaybeConst<CLASS##Type> *T); \
virtual bool Visit##CLASS##Type(MaybeConst<CLASS##Type> *T) { return true; }
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/AST/DynamicRecursiveASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ template <bool Const> struct Impl : RecursiveASTVisitor<Impl<Const>> {
return Visitor.Traverse##CLASS##Decl(D); \
}
#include "clang/AST/DeclNodes.inc"

#define ABSTRACT_DECL(DECL)
#define DECL(CLASS, BASE) \
bool Visit##CLASS##Decl(CLASS##Decl *D) { \
return Visitor.Visit##CLASS##Decl(D); \
Expand All @@ -246,6 +246,7 @@ template <bool Const> struct Impl : RecursiveASTVisitor<Impl<Const>> {
}
#include "clang/AST/TypeNodes.inc"

#define ABSTRACT_TYPE(CLASS, BASE)
#define TYPE(CLASS, BASE) \
bool Visit##CLASS##Type(CLASS##Type *T) { \
return Visitor.Visit##CLASS##Type(T); \
Expand Down

0 comments on commit 44c0719

Please sign in to comment.