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

compilation error with Clang 3.4 #5341

Open
wojdyr opened this issue Aug 27, 2024 · 0 comments
Open

compilation error with Clang 3.4 #5341

wojdyr opened this issue Aug 27, 2024 · 0 comments
Labels
triage New bug, unverified

Comments

@wojdyr
Copy link
Contributor

wojdyr commented Aug 27, 2024

What version (or hash if on master) of pybind11 are you using?

2.13.5

Problem description

I suppose Clang 3.4 is not widely used anymore, but just to let you know.
I tried building my bindings on an old system with Clang 3.4 and I got:

include/pybind11/detail/type_caster_base.h:260:9: error: 
      return type 'pybind11::handle' must match previous return type 'const pybind11::handle' when
      lambda expression has unspecified explicit return type
        return handle();
        ^

It's this lambda:

return with_instance_map(src, [&](instance_map &instances) {
auto it_instances = instances.equal_range(src);
for (auto it_i = it_instances.first; it_i != it_instances.second; ++it_i) {
for (auto *instance_type : detail::all_type_info(Py_TYPE(it_i->second))) {
if (instance_type && same_type(*instance_type->cpptype, *tinfo->cpptype)) {
return handle((PyObject *) it_i->second).inc_ref();
}
}
}
return handle();
});

After adding -> handle as the return type, the compiler was satisfied and I didn't come across any other problems.

Is this a regression? Put the last known working version here if it is.

must be a regression, but I don't know what was the last working version

@wojdyr wojdyr added the triage New bug, unverified label Aug 27, 2024
@wojdyr wojdyr changed the title doesn't compile with Clang 3.4 compilation error with Clang 3.4 Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage New bug, unverified
Projects
None yet
Development

No branches or pull requests

1 participant