pybind / pybind11

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

fix: add guard for GCC <10.3 on C++20 #5205

Closed InvincibleRMC closed 5 days ago

InvincibleRMC commented 5 days ago

Description

Fixes #5201 and updates CI.

Suggested changelog entry:

   Fix regression introduced in #5201 for GCC<10.3 in C++20 mode.
InvincibleRMC commented 5 days ago

Let me know if it is desired to store the guard somewhere else and have it referenced or just having 4 instances of the guard is fine.

InvincibleRMC commented 5 days ago

Also please let me know if you want to test on gcc 10.1 or 10.2 if that is even possible.

rwgk commented 5 days ago

AFK for a few more hours, can't look at code until then, but: let's not do anything complicated. Low hanging fruits will do. IMO

On Thu, Jun 27, 2024 at 16:35 Michael Carlstrom @.***> wrote:

Also please let me know if you want to test on gcc 10.1 or 10.2 if that is even possible.

— Reply to this email directly, view it on GitHub https://github.com/pybind/pybind11/pull/5205#issuecomment-2195831599, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFUZAG7CR5WWHGNEQL6Y4LZJSOTDAVCNFSM6AAAAABKAYBWU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJVHAZTCNJZHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rwgk commented 5 days ago

Let me know if it is desired to store the guard somewhere else and have it referenced or just having 4 instances of the guard is fine.

Yeah, that was a bit much of duplicated code, but it's very easily avoided. I went ahead and did that. Thanks for creating this PR, from there it was very quick.