Skip to content

[3.x] Bump to c++17 #107847

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

Merged
merged 1 commit into from
Jul 2, 2025
Merged

[3.x] Bump to c++17 #107847

merged 1 commit into from
Jul 2, 2025

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented Jun 22, 2025

As discussed, we want to upgrade to c++17 for a few new bits of super useful functionality, especially if constexpr.

I have a later PR for adding some of the compiler requirements we have in 4.x (in SConstruct) but hopefully this should be okay to get started.

Notes

@lawnjelly lawnjelly added this to the 3.7 milestone Jun 22, 2025
@lawnjelly lawnjelly requested a review from a team as a code owner June 22, 2025 14:13
@lawnjelly lawnjelly requested a review from akien-mga June 22, 2025 14:15
@Ivorforce
Copy link
Member

You might want to update some checks, using @Repiteo's C++20 PR as reference: #100749

I'm not sure how much of this transfers, but I expect there should be at least analogous checks in 3.x

@Ivorforce Ivorforce requested a review from Repiteo June 22, 2025 14:17
@lawnjelly
Copy link
Member Author

lawnjelly commented Jun 22, 2025

Yeah I have a WIP PR already, I'll make it draft : #107851

Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good from my side, though we should still get build system feedback :)

@lawnjelly
Copy link
Member Author

lawnjelly commented Jun 23, 2025

On thing that is interesting is that the WIP PR for checking the compiler versions (which corresponds to 4.x with c++17) is flagging one of the compilers as being old, so maybe is a little out of date for c++17 for some features.

But we can discuss changing that on #107844.

I'm happy either going ahead here or waiting till we decide on that, just as long as we can start using if conspexpr soonish. We aren't planning on making builds imminently but it would be nice to sort out the compiler versions.

UPDATE:
Seem to have fixed the compiler version bug so I think we should be good to go.
But I'll wait to get a second opinion from @akien-mga / @Repiteo (as I think Repiteo did a lot of work in checking compiler versions?).

Copy link
Contributor

@Repiteo Repiteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This barely scratches the surface of what potentially changed with C++17, but I also don't think this PR was meant to delve into that either. In terms of pure functionality, this is technically all you need… With the caveat that several followup PRs are a certainty.

@lawnjelly lawnjelly merged commit 79de851 into godotengine:3.x Jul 2, 2025
14 checks passed
@lawnjelly lawnjelly deleted the bump_c++17 branch July 2, 2025 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants