Skip to content

Commit

Permalink
Enable C++20 on Linux.
Browse files Browse the repository at this point in the history
Doing this in advance of enabling for more platforms allows monitoring
compile-time effects with less chance of adversely affecting the CQ,
while still getting the benefit of breaking a bot if someone lands a
change that breaks the build only in C++20.

Bug: 1284275
Change-Id: Iff87b2114ad1be7c3f23dadc16f115f612d91d71
Cq-Include-Trybots: luci.chromium.try:linux-gcc-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3932022
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1054983}
  • Loading branch information
pkasting authored and Chromium LUCI CQ committed Oct 4, 2022
1 parent 8e0b762 commit 5bbd4e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,15 @@ config("compiler") {
if (is_clang) {
cflags_cc += [ "-fno-trigraphs" ]
}
} else if (is_linux) {
# TODO(crbug.com/1284275): Switch to C++20 on all platforms.
if (is_clang) {
cflags_cc += [ "-std=${standard_prefix}++20" ]
} else {
# The gcc bots are currently using GCC 9, which is not new enough to
# support "c++20"/"gnu++20".
cflags_cc += [ "-std=${standard_prefix}++2a" ]
}
} else {
cflags_cc += [ "-std=${standard_prefix}++17" ]
}
Expand Down

0 comments on commit 5bbd4e5

Please sign in to comment.