Skip to content
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

Add a conditional compilation directive to be compatible with C++26 #1367

Merged
merged 3 commits into from
Mar 1, 2025

Conversation

vspefs
Copy link
Contributor

@vspefs vspefs commented Feb 12, 2025

cppfront now fails to compile under C++26 for a simple repetition of definition (documented beforehand) with C++26 standard library.

The comments in source/common.h documented:

//  In keep trying to write string+string_view, and it ought to Just Work without
//  the current workarounds. Not having that is a minor impediment to using safe
//  and efficient string_views, which we should be encouraging. So for my own use
//  and to remove that minor impediment to writing safe and efficient code, I'm
//  just going to add this until we get P2591 in C++26(?) -- See: wg21.link/p2591
//

and now P2591 has been accepted and assigned a feature test macro, we just have to conditionally disable it with FTM (__cpp_lib_string_view). Then we can have cppfront compiled and running under C++26.

Signed-off-by: vspefs <[email protected]>
@hsutter
Copy link
Owner

hsutter commented Mar 1, 2025

Thanks!

This is almost editorial so I won't ask for a CLA, but if you intend to submit any future PRs please email me (first dot last at gmail) with your full name and I'll send you a one-time CLA to sign that will cover your future PRs.

@hsutter hsutter merged commit 482542b into hsutter:main Mar 1, 2025
@vspefs vspefs deleted the cpp26 branch March 1, 2025 05:48
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