Skip to content

add GetTemplateInstantiatedFunctions #642

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vipul-Cariappa
Copy link
Collaborator

Description

lookup instantated templated functions

Fixes # (issue)

1 test in cppyy

Type of change

Please tick all options which are relevant.

  • Bug fix
  • New feature
  • Requires documentation updates

Testing

Included

Checklist

  • I have read the contribution guide recently

lookup instantated templated functions
@@ -863,6 +863,21 @@ void GetFunctionTemplatedDecls(TCppScope_t klass,
GetClassDecls<FunctionTemplateDecl>(klass, methods);
}

void GetTemplateInstantiatedFunctions(const std::string& name,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why would we need all possible instantiations? That encourages iteration other expensive operations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Required here.

In cppyy, if there is an instantiation of a templated function, then it is treated as an overloaded function. This also prevents instantiation because we have already extracted the instantiated functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should avoid iteration. Perhaps we can use some level of FindInstantiation or similar, which does not push everything onto a vector…

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.82%. Comparing base (bc728d3) to head (4ff0941).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #642      +/-   ##
==========================================
+ Coverage   78.77%   78.82%   +0.04%     
==========================================
  Files           9        9              
  Lines        3849     3858       +9     
==========================================
+ Hits         3032     3041       +9     
  Misses        817      817              
Files with missing lines Coverage Δ
include/CppInterOp/CppInterOp.h 95.34% <ø> (ø)
lib/CppInterOp/CppInterOp.cpp 86.73% <100.00%> (+0.05%) ⬆️
Files with missing lines Coverage Δ
include/CppInterOp/CppInterOp.h 95.34% <ø> (ø)
lib/CppInterOp/CppInterOp.cpp 86.73% <100.00%> (+0.05%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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