We've decided to use _LIBCPP_STD_VER >= xy while discussing to change the constexpr macros, so let's finally bump the version macro to match that.
Details
- Reviewers
ldionne Mordante var-const huixie90 avogelsgesang - Group Reviewers
Restricted Project - Commits
- rG860753934ca3: [libc++] Bump _LIBCPP_STD_VER to the next expected C++ version
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
We've decided to use _LIBCPP_STD_VER >= xy while discussing to change the constexpr macros, so let's finally bump the version macro to match that.
I don't recall that was decided during that in that review. Can you share the link where that decision was made? (Or remove that part of the commit message.)
Regardless of the objection above I still think this change is nice to have. Based on the track record of the committee I feel we can expect the 3 year cycle. (Even when 26 becomes 27 it will be a simple search and replace.)
A few nits otherwise LGTM. I feel more developers should have a look so I leave the final approval to them.
libcxx/include/__config | ||
---|---|---|
50 | ||
51 | Please do the same for the test macro including the comment. |
I brought it up during the discussion on Discord and nobody objected, so I assumed everybody was OK with it. @avogelsgesang and @ldionne also explicitly asked about it there.
libcxx/include/__config | ||
---|---|---|
51 | The test macro is defined as 99 currently, so we can already use TEST_STD_VER >= 23. |
LGTM!
Are you planning to also replace existing usages of, e.g. #if _LIBCPP_STD_VER > 17 by #if _LIBCPP_STD_VER >= 20?
I'm not sure that part is worth the churn. I'd welcome a patch, but depending on how crazy it ends up being, I think it might not be the best idea.
I don't feel "I assumed everybody was OK with it" sounds as a discision.
I don't mind seeing it in new code. But rather not see existing code in, areas with a lot of active development, changed. Or changes that affect patches under review.
libcxx/include/__config | ||
---|---|---|
51 | Until C++23 is released, I would recommend not changing these macros. The test macro is defined differently than the one in __config in an attempt to make it harder for people to depend on numbers that are not guaranteed to be stable. The code XXX_STD_VER > 20 will work for all standard versions later than C++20. |
I do remember we had a discussion on Discord and several folks chimed in, but I don't remember exactly who did. My understanding after the discussion on Discord is that we were going to move forward with this approach. My understanding is also that I was the only one to oppose at the beginning.
IMO then, for the future, we should make it clear whether we reached consensus and what the way forward is.
I would say a good way to do that is to update our libc++ developer documentation to reflect the new agreement.
AFAIK we only agreed to update the macro so we can use >= 23 but not require to use this new style. I really would like to have one style in one file and not to mix them in one file.
libcxx/include/__config | ||
---|---|---|
51 | @mclow.lists For my curiosity can you tell why you don't recommend to change this macro? |