pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.09k stars 2.05k forks source link

Fixed a compilation error with gcc 14 #5208

Closed wenqing closed 4 days ago

wenqing commented 5 days ago

Description

Fixes #5206, which is caused by a missed header algorithm .

Suggested changelog entry:

A missing ``#include <algorithm>`` in pybind11/typing.h was added, to fix a GCC 14 build error.
InvincibleRMC commented 4 days ago

Should gcc 14 be added to the CI matrix?

rwgk commented 4 days ago

Thanks!

rwgk commented 4 days ago

Should gcc 14 be added to the CI matrix?

Oh, yes.

Sorry looks like I was too fast.

But: Maybe it's not actually GCC 14 specific? But related to what other includes are in user code?

rwgk commented 4 days ago

What I mean: What's really missing is automatic checks for IWYU correctness. (I think it's a difficult project to add that.)

InvincibleRMC commented 4 days ago

What I mean: What's really missing is automatic checks for IWYU correctness. (I think it's a difficult project to add that.)

Makes sense

rwgk commented 4 days ago

If someone wants to work on IWYU, this is what we use Google-internally:

https://github.com/google/pybind11k/pull/30113

I GUESS we could run https://clangd.llvm.org/design/include-cleaner under GHA. I never got a chance to look any deeper.

For completeness: Google-internally the pybind11 client code is kept IWYU clean, but pybind11 itself is not. (That would have to happen here.)