Skip to content

[EXPERIMENTAL] Drop C++11 and C++14 support - #6124

Open
rwgk wants to merge 6 commits into
pybind:masterfrom
rwgk:drop_cxx11_cxx14
Open

[EXPERIMENTAL] Drop C++11 and C++14 support#6124
rwgk wants to merge 6 commits into
pybind:masterfrom
rwgk:drop_cxx11_cxx14

Conversation

@rwgk

@rwgk rwgk commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Description

EXPERIMENTAL/WIP

(Not Draft only so that the full CI runs.)

Suggested changelog entry:

  • Placeholder.

@rwgk
rwgk requested a review from henryiii as a code owner August 3, 2026 08:00
@rwgk
rwgk force-pushed the drop_cxx11_cxx14 branch from 6942ffb to 871b8a2 Compare August 3, 2026 08:58
@henryiii

henryiii commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

A few notes:

  • I want to make our next release first, then I'm personally fine with it, 17 is pretty widely supported now. I guess we'll have to find something for 11 so we can redefine what the 11 in our name means. :)
  • The interesting thing would be to see how much this changes/drops/simplifies.
  • This does raise our minimum macOS requirement on older CPythons (from memory, I think <3.12.4). That's been the reason I've avoided it so far. I think all other platforms are basically unaffected.

@rwgk

rwgk commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

A few notes:

  • I want to make our next release first,

Sounds best to me, too.

  • The interesting thing would be to see how much this changes/drops/simplifies.

I agree. But there is also the aspect that dropping C++11 and C++14 unshackles future developments. We're already at 9 years plus 17, it seems like a very long wait already. We could maintain 3.1.x (still C++11) for a couple more years, probably the effort for that will be less than what we'd pay for staying C++11 compatible on the mainline.

  • This does raise our minimum macOS requirement on older CPythons (from memory, I think <3.12.4). That's been the reason I've avoided it so far. I think all other platforms are basically unaffected.

Ah, I didn't realize. That would be another argument for actively maintaining 3.1.x until Python 3.11 reaches EOL.

@Skylion007

Copy link
Copy Markdown
Collaborator

You should ask Claude/Codex to update the Clang-Tidy rules too, a ton of opted out modernize rules can be enabled with this PR.

#ifndef PYBIND11_CPP17

template <typename T>
constexpr const char

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 am more interested in how many complex templates can be removed with if constexpr

@Skylion007

Copy link
Copy Markdown
Collaborator

Also a ton of const strings ref that could be std::string_views now

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.

3 participants