Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/interop/interop_wrapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1173,16 +1173,31 @@ ptrdiff_t interop::GetBaseOffset(TCppScope_t derived, TCppScope_t base,
}

// method/function reflection information ------------------------------------
// A deleted overload is not callable, and leaving it in the set adds a
// spurious conversion error to every failed-call report.
static void
remove_deleted_methods(std::vector<interop::TCppMethod_t>& methods) {
methods.erase(std::remove_if(methods.begin(), methods.end(),
[](interop::TCppMethod_t m) {
return Cpp::IsFunctionDeleted(m);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess here the question for @Vipul-Cariappa is if the new system suggests deleted functions and is that what general c++ do?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe this is filtering the lookup and not the overload resolution. This should be fine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, thank you!

}),
methods.end());
}

void interop::GetClassMethods(TCppScope_t scope,
std::vector<interop::TCppMethod_t>& methods) {
std::lock_guard<std::recursive_mutex> Lock(InterOpMutex);
Cpp::GetClassMethods(scope, methods);
remove_deleted_methods(methods);
}

std::vector<interop::TCppMethod_t>
interop::GetMethodsFromName(TCppScope_t scope, const std::string& name) {
std::lock_guard<std::recursive_mutex> Lock(InterOpMutex);
return Cpp::GetFunctionsUsingName(scope, name);
std::vector<interop::TCppMethod_t> methods =
Cpp::GetFunctionsUsingName(scope, name);
remove_deleted_methods(methods);
return methods;
}

std::string interop::GetName(TCppScope_t method) {
Expand Down
1 change: 0 additions & 1 deletion test/test_crossinheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,6 @@ def func(self):
c = C()
assert c.func() == 3

@mark.xfail(reason="deriving from a ctor-less base does not raise TypeError")
def test34_no_ctors_in_base(self):
"""Base classes with no constructors"""

Expand Down
Loading