It's time to default-allow C++20

72 views
Skip to first unread message

Peter Kasting

unread,
Jan 24, 2026, 2:28:34 PM (7 days ago) Jan 24
to cxx
To whomever is driving C++ style these days:

C++20 was initially supported in Nov 2023, which was more than two years ago. Per the Modern C++ Features policy, that means it's time to make final decisions on any remaining TBD items, biasing towards allowing, and then default-allow that language version (removing all the text from that page explicitly allowing parts of C++20).

I won't be driving that discussion, but I wanted to mention this here in hopes someone else would.

And while I'm at it, kudos to everyone who worked to get C++23 supported. I'm surprised and pleased it happened as soon as it did. Good work!

PK

Kyle Charbonneau

unread,
Jan 28, 2026, 4:41:06 PM (3 days ago) Jan 28
to Peter Kasting, cxx
Thanks for bringing this up Peter. There are three features marked TBD that seem straightforward (IMO) to move to the banned list pending future discussion.
  • <coroutine>
    • It isn't clear how to integrate coroutines with the existing post-task system. There was discussion about it in this thread.
    • Clang doesn't currently support coroutines for win32 which is problematic.
  • <format> 
    • This would require a large migration effort for existing base::StringPrintf() usage due to different format specifiers. 
    • base::StringPrintf was changed to use absl::StrFormat internally already (thanks Peter!). A decision on absl::StrFormat vs <format> would have to be made.
  • <source_location> 
    • std::source_location would be used in place of base::Location. Leaving <source_location> banned until there is a plan for how that migration would work seems reasonable.
That would leave the following features as TBD. I don't have any initial thoughts on these but others might.
Kyle

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/cxx/a3876239-6364-4453-bf4b-c448e250ce8en%40chromium.org.

Nico Weber

unread,
Jan 29, 2026, 8:55:38 AM (2 days ago) Jan 29
to Kyle Charbonneau, Peter Kasting, cxx
On Wed, Jan 28, 2026 at 4:41 PM Kyle Charbonneau <kyle...@chromium.org> wrote:
Thanks for bringing this up Peter. There are three features marked TBD that seem straightforward (IMO) to move to the banned list pending future discussion.

This sounds right to me.
  • <coroutine>
    • It isn't clear how to integrate coroutines with the existing post-task system. There was discussion about it in this thread.
    • Clang doesn't currently support coroutines for win32 which is problematic.
  • <format> 
    • This would require a large migration effort for existing base::StringPrintf() usage due to different format specifiers. 
    • base::StringPrintf was changed to use absl::StrFormat internally already (thanks Peter!). A decision on absl::StrFormat vs <format> would have to be made.
  • <source_location> 
    • std::source_location would be used in place of base::Location. Leaving <source_location> banned until there is a plan for how that migration would work seems reasonable.
That would leave the following features as TBD. I don't have any initial thoughts on these but others might.
I think I'd prefer to ban this, as it seems more bug-prone than brace-init and the difference is very subtle. I don't think we have great tools to enforce the ban though.
Given we ban char8_t, we should probably ban this too.
 
Kyle

On Sat, Jan 24, 2026 at 2:28 PM Peter Kasting <pkas...@chromium.org> wrote:
To whomever is driving C++ style these days:

C++20 was initially supported in Nov 2023, which was more than two years ago. Per the Modern C++ Features policy, that means it's time to make final decisions on any remaining TBD items, biasing towards allowing, and then default-allow that language version (removing all the text from that page explicitly allowing parts of C++20).

I won't be driving that discussion, but I wanted to mention this here in hopes someone else would.

And while I'm at it, kudos to everyone who worked to get C++23 supported. I'm surprised and pleased it happened as soon as it did. Good work!

PK

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/cxx/a3876239-6364-4453-bf4b-c448e250ce8en%40chromium.org.

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
Reply all
Reply to author
Forward
0 new messages