Skip to content
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

[libclang] Visit function template instantiations #67928

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Danacus
Copy link

@Danacus Danacus commented Oct 1, 2023

This PR changes CursorVisitor::VisitFunctionTemplateDecl such that instantiations of the function template (e.g. template void foo<int>();) are visited as children of the FunctionTemplateDecl. This also applies to class methods.

The use case for this I have in mind would be to add limited support for function templates in rust-bindgen (see rust-lang/rust-bindgen#2650).

Additionally, I have taken the liberty to add CXCursor_CXXMethod to the list of cursors supported by getTemplateArgument, since I found it a bit odd that this was not the case before.

Please let me know if there is anything that needs to be changed, I'm happy to make changes if necessary.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 1, 2023
@github-actions
Copy link

github-actions bot commented Oct 1, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

@AaronBallman AaronBallman self-requested a review October 7, 2023 12:46
@AaronBallman AaronBallman added the clang:as-a-library libclang and C++ API label Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:as-a-library libclang and C++ API clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants