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 operator resolution #129

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

Conversation

Vipul-Cariappa
Copy link
Collaborator

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

GetMethodTemplate now also checks for operators methods using GetClassOperators
GetGlobalOperator can now handle templated types

Fixes 2 tests. Along with compiler-research/CppInterOp#509, fixes 3 tests.

`GetMethodTemplate` now also checks for operators methods using `GetClassOperators`

`GetGlobalOperator` can now handle templated types
Copy link
Collaborator

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM!

@Vipul-Cariappa
Copy link
Collaborator Author

@vgvassilev, something is failing with cling. Call to gbl.Cpp.Declare(code) fails. But if I force it to compile an empty string before compiling the actual code, it passes.
Any ideas, on what might be causing this? I suspect we need to do something in InterOp.

@vgvassilev
Copy link
Collaborator

@vgvassilev, something is failing with cling. Call to gbl.Cpp.Declare(code) fails. But if I force it to compile an empty string before compiling the actual code, it passes. Any ideas, on what might be causing this? I suspect we need to do something in InterOp.

Maybe Declare just parses and does not do jit and some previous call needed to be finalized or something like that?

void Cppyy::GetClassOperators(Cppyy::TCppScope_t klass,
const std::string& opname,
std::vector<TCppScope_t>& operators) {
if (opname == "operator+")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is something we can fold into an API: const char * GetOperatorKindAsString(Cpp::OperatorKind K);

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