[EXPERIMENTAL] Drop C++11 and C++14 support - #6124
Conversation
|
A few notes:
|
Sounds best to me, too.
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.
Ah, I didn't realize. That would be another argument for actively maintaining 3.1.x until Python 3.11 reaches EOL. |
|
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 |
There was a problem hiding this comment.
I am more interested in how many complex templates can be removed with if constexpr
|
Also a ton of const strings ref that could be std::string_views now |
Drop C++11/C++14 work notes — snapshot at 2026-08-03 10:50 PDTThis is a resumable snapshot of the experimental C++17 migration work for Repository and PR state
Do not assume that Working strategyThe intended process is deliberately gated:
This is partly to keep the migration safe and partly because the project has Maintainer contextIn Henry's latest PR comment before the production-code work:
The experimental status remains useful: dropping the language modes and the Commit sequenceOldest first:
The Clang 8 and Debian-snapshot commits record a useful diagnostic path, but What the workflow commits doThe workflow pass conceptually replaced retained C++11/C++14 builds with C++17
Known optional workflow reductions, deliberately not taken yet:
The original standalone note is: Clang-lane investigation and final matrix decisionPromoting the old Clang 5 row from C++14 to C++17 exposed a real toolchain The attempted Clang 8 replacement demonstrated two further facts:
The final matrix therefore uses:
This records Clang 11 as the oldest continuously tested LLVM toolchain. It does The full workflow-only CI gate for C++17 contract commit:
|
Hi @Skylion007, I won't be able to work on this for a while, but I just added a couple comments that should make it possible for you (or anyone) to pick up where I left off:
The idea is that you can feed this PR to your favorite agent/model to continue. Please feel free to add commits, but please don't rebase or force push. Simply keep merging and adding commits, that's something an agent (or me) can easily follow. |
|
Spiel: By the way, I strongly, strongly recommend rebasing for a long-lived branch like this. If the stack goes in first (which I'd really like for it to!), then this will likely make no sense with a merge comment. Rebasing will make every commit continue to make sense and continue to tell a story. Agents, like humans, work better with rebasing; linear history is much, much simpler. Also, by the way, GitHub's new stacks feature does not support merges, they require always rebasing. Rebases preserve the original story, but applied to the current codebase. I've seen a long-lived PR die (in pypa/build) because there was no way to recover it after a dozen merge commits. Also, as I've pointed out before, every past commit remains accessible in git after a force push. Anyway, I'm thinking I can pull out the C++11 drop and see what that looks like on its own. There's no drawback at all going C++14, while there's a tiny bit going C++17, and I'm curious to see what it looks like. |
Description
EXPERIMENTAL/WIP
(Not Draft only so that the full CI runs.)
Suggested changelog entry: