Skip to content

Reapply 44c0719e77b37374c89b7fc1320664ebb404323d with fix; NFC #125100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

AaronBallman
Copy link
Collaborator

Silence MSVC warnings; NFC
After the changes to DynamicRecursiveASTVisitor, we started getting several warnings from MSVC like:

warning C4661: 'bool clang::DynamicRecursiveASTVisitorBase::WalkUpFromNamedDecl(clang::NamedDecl *)': no suitable definition provided for explicit template instantiation request

These changes silence the warnings by providing a definition for those functions.

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.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jan 30, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 30, 2025

@llvm/pr-subscribers-clang

Author: Aaron Ballman (AaronBallman)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/125100.diff

1 Files Affected:

  • (modified) clang/include/clang/AST/DynamicRecursiveASTVisitor.h (+2-2)
diff --git a/clang/include/clang/AST/DynamicRecursiveASTVisitor.h b/clang/include/clang/AST/DynamicRecursiveASTVisitor.h
index 4e0ba568263bf3..703cca22777ad0 100644
--- a/clang/include/clang/AST/DynamicRecursiveASTVisitor.h
+++ b/clang/include/clang/AST/DynamicRecursiveASTVisitor.h
@@ -251,11 +251,11 @@ template <bool IsConst> class DynamicRecursiveASTVisitorBase {
   // Decls.
 #define ABSTRACT_DECL(DECL)
 #define DECL(CLASS, BASE)                                                      \
+  bool WalkUpFrom##CLASS##Decl(MaybeConst<CLASS##Decl> *D);                    \
   virtual bool Traverse##CLASS##Decl(MaybeConst<CLASS##Decl> *D);
 #include "clang/AST/DeclNodes.inc"
 
 #define DECL(CLASS, BASE)                                                      \
-  bool WalkUpFrom##CLASS##Decl(MaybeConst<CLASS##Decl> *D);                    \
   virtual bool Visit##CLASS##Decl(MaybeConst<CLASS##Decl> *D) { return true; }
 #include "clang/AST/DeclNodes.inc"
 
@@ -272,11 +272,11 @@ template <bool IsConst> class DynamicRecursiveASTVisitorBase {
   // Types.
 #define ABSTRACT_TYPE(CLASS, BASE)
 #define TYPE(CLASS, BASE)                                                      \
+  bool WalkUpFrom##CLASS##Type(MaybeConst<CLASS##Type> *T);                    \
   virtual bool Traverse##CLASS##Type(MaybeConst<CLASS##Type> *T);
 #include "clang/AST/TypeNodes.inc"
 
 #define TYPE(CLASS, BASE)                                                      \
-  bool WalkUpFrom##CLASS##Type(MaybeConst<CLASS##Type> *T);                    \
   virtual bool Visit##CLASS##Type(MaybeConst<CLASS##Type> *T) { return true; }
 #include "clang/AST/TypeNodes.inc"
 

Copy link
Contributor

@cor3ntin cor3ntin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AaronBallman AaronBallman merged commit 72efe15 into llvm:main Jan 30, 2025
11 checks passed
@AaronBallman AaronBallman deleted the aballman-msvc-warning-dyn-recurse branch January 30, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants