-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Introducing C++20, dropping C++11 #1127
Comments
I'm aware of at least one difference. The type returned by All of this is subject to change and assuming that C++17 mode is equivalent to C++20 mode might cause future breakages. |
Thanks for the context on this! |
Could you comment on why this issue should be closed already? Is there an updated timeline for either dropping C++11 and/or adding C++20? |
I'm not sure what the issue is. I thought I answered your question. C++20 should be supported at this point. I'm not 100% sure when we will stop supporting C++11, but the statement you quoted says that you should not rely on it continuing much longer. Is there some other question I didn't answer? |
Just to be sure, I'm not complaining, I was just curious. AFAICT, there's no other publicly visible issue that tracks dropping C++11, and to be honest I wasn't sure about the status of C++20 either - it's great to hear that it's supported (as in: it compiles), but if it's actually a legitimate target cxx version for abseil now then I think that it should be documented as such... Feel free to close this issue if you think these things are sufficiently tracked somewhere else or google-internally, but ceteris paribus, I'd close this at the earliest when C++11 is dropped. |
This is now complete. As of 97ab3dc, building in C++11 mode is an error. |
@derekmauro 1) Is there a plan to document the various places in which the Abseil ABI differs between C++17 and C++20? Also, 2) is there a plan to add a flag in |
Thanks @pitrou. This should probably be a new issue. IMO if the types are different (in an ABI relevant way), there should definitely be an option to enable/disable it, like all the others in |
@pitrou - Is there really code in the wild that is using the return type of |
@derekmauro I have absolutely no idea! |
You should ask your colleague Hyrum. ;-) Jokes aside, from the POV of integration, if differences can occur, they will, given enough projects & enough time. I'd really really prefer to be explicit on these differences, as abseil is already quite a handful to distribute (prebuilt, over an entire ecosystem) in a sane fashion. |
The return type of |
I think we have to face that people will more often than not use something "incorrect" that works for them. Such stuff creeps into projects everywhere eventually and I worry that merely having a difference we have no control over will not only come back to haunt us (=integrators) over time, but will usually be quite tricky to debug. It's indeed possible that The goal is not to put an undue burden on abseil, yet it's a very unusual situation that the ABI changes depending on which C++ version is used to compile. We have projects in our ecosystem that use anything from C++11 to C++20, and while not all of them will depend on abseil, all of them should in principle be co-installable, and in particular, projects depending on abseil might have (less divergent but still) different requirements e.g. some which require C++20 already vs. those that aren't even ready for C++17 yet. |
I don't have any real-world example to show, but |
Assuming C++ >= 17: https://godbolt.org/z/jhhWc8W7b Of course there are other ways to write this code that does not depend on a stable ABI, but this is not perverse code either. |
Whether intentional or not, https://code-review.googlesource.com/c/re2/+/61250 made re2 depend directly on abseil. The latest version of abseil now requires C++14 (abseil/abseil-cpp#1127). However, it seems that supplying `-std=c++14` isn't enough (abseil/abseil-cpp#1431). `-std=c++17` needs to be used at least. This commit fixes the compilation by trying C++20 and C++17 if the initial compilation fails. This fixes build issues on macOS.
https://code-review.googlesource.com/c/re2/+/61250 made re2 depend directly on abseil. The latest version of abseil now requires C++14 (abseil/abseil-cpp#1127). However, it seems that supplying `-std=c++14` isn't enough (abseil/abseil-cpp#1431). `-std=c++17` needs to be used at least. This commit fixes the compilation by trying C++20 and C++17 if the initial compilation fails. This fixes build issues on macOS.
https://code-review.googlesource.com/c/re2/+/61250 made re2 depend directly on abseil. The latest version of abseil now requires C++14 (abseil/abseil-cpp#1127). However, it seems that supplying `-std=c++14` isn't enough (abseil/abseil-cpp#1431). `-std=c++17` needs to be used at least. This commit fixes the compilation by trying C++20 and C++17 if the initial compilation fails. This fixes build issues on macOS.
In the 2020 platform update there's the following statement:
I'm encountering projects that are starting to need C++20 but still want to compile against abseil, which goes against abseil's expectation that:
Does abseil already switch anything based on C++20? Is it correct to assume for the time being that compiling abseil with C++20 is currently equivalent to C++17?
The text was updated successfully, but these errors were encountered: