Skip to content

🍒[Clang] Dispatch default overloads of TemplateArgumentVisitor to the implementation #9554

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
merged 1 commit into from
Nov 8, 2024

Conversation

egorzhdan
Copy link

This fixes an issue where overriding
clang::ConstTemplateArgumentVisitor::VisitTemplateArgument in an implementation visitor class did not have the desired effect: the overload was not invoked when one of the visitor methods (e.g. VisitDeclarationArgument) is not implemented, instead it dispatched to clang::ConstTemplateArgumentVisitor::VisitTemplateArgument itself and always returned a default-initialized result.

This makes TemplateArgumentVisitor and ConstTemplateArgumentVisitor follow the implicit convention that is followed elsewhere in Clang AST, in RecursiveASTVisitor and TypeVisitor.

(cherry picked from commit d4525b0)

…e implementation

This fixes an issue where overriding
`clang::ConstTemplateArgumentVisitor::VisitTemplateArgument` in an
implementation visitor class did not have the desired effect: the
overload was not invoked when one of the visitor methods (e.g.
`VisitDeclarationArgument`) is not implemented, instead it dispatched to
`clang::ConstTemplateArgumentVisitor::VisitTemplateArgument` itself and
always returned a default-initialized result.

This makes `TemplateArgumentVisitor` and `ConstTemplateArgumentVisitor`
follow the implicit convention that is followed elsewhere in Clang AST,
in `RecursiveASTVisitor` and `TypeVisitor`.

(cherry picked from commit d4525b0)
@egorzhdan egorzhdan requested a review from Xazax-hun November 8, 2024 14:39
@egorzhdan
Copy link
Author

@swift-ci please test LLVM

@egorzhdan
Copy link
Author

@swift-ci please test

@egorzhdan egorzhdan merged commit 14e578f into stable/20240723 Nov 8, 2024
5 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/20240723-class-template-packs branch November 8, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants