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

Improve template instantiate #511

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

Conversation

Vipul-Cariappa
Copy link
Collaborator

@Vipul-Cariappa Vipul-Cariappa commented Feb 26, 2025

Description

Match parameter types to argument types in cases of when the parameter type itself is templated.

Fixes # (issue)

Helps fix up to 4 tests in cppyy.

Also fixes the compiler-research/cppyy-backend#129 's cling failure.

Please tick all options which are relevant.

  • Bug fix
  • New feature
  • Requires documentation updates

Testing

Included tests. I feel codecov will still not be happy. Will add more according to its suggestions.

Checklist

  • I have read the contribution guide recently

Match parameter types to argument types in cases of
when the parameter type itself is templated
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

// matching parameter and argument types
// resolving parameter
const auto* fn_TST =
fn_arg_type->getAs<clang::TemplateSpecializationType>();
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "clang::TemplateSpecializationType" is directly included [misc-include-cleaner]

          fn_arg_type->getAs<clang::TemplateSpecializationType>();
                                    ^

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 87.50000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 72.58%. Comparing base (294da5b) to head (c614a29).

Files with missing lines Patch % Lines
lib/Interpreter/CppInterOp.cpp 92.45% 4 Missing ⚠️
include/clang/Interpreter/CppInterOp.h 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #511      +/-   ##
==========================================
+ Coverage   72.45%   72.58%   +0.12%     
==========================================
  Files           9        9              
  Lines        3591     3647      +56     
==========================================
+ Hits         2602     2647      +45     
- Misses        989     1000      +11     
Files with missing lines Coverage Δ
include/clang/Interpreter/CppInterOp.h 86.66% <0.00%> (-9.63%) ⬇️
lib/Interpreter/CppInterOp.cpp 82.72% <92.45%> (+0.05%) ⬆️
Files with missing lines Coverage Δ
include/clang/Interpreter/CppInterOp.h 86.66% <0.00%> (-9.63%) ⬇️
lib/Interpreter/CppInterOp.cpp 82.72% <92.45%> (+0.05%) ⬆️

@@ -676,6 +676,15 @@ namespace Cpp {
const char* m_IntegralValue;
TemplateArgInfo(TCppScope_t type, const char* integral_value = nullptr)
: m_Type(type), m_IntegralValue(integral_value) {}
friend bool operator==(const TemplateArgInfo& lhs,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why having a friend operator here?

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