Actually build libc++ and libc++abi with -std=c++20

build/config/compiler/BUILD.gn adds the flag to cflags_cc, so this
config here must do that too. Else the -std=c++20 will show up
on the commandline _before_ the -std=c++17 added by
build/config/compiler:compiler, rendering it ineffective.

Bug: 1298070
Change-Id: I145b04aeef1003620594a0be8f74bb7731797069
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3469402
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Arthur Eubanks <aeubanks@google.com>
Commit-Queue: Arthur Eubanks <aeubanks@google.com>
Cr-Commit-Position: refs/heads/main@{#972250}
NOKEYCHECK=True
GitOrigin-RevId: d95d20a3f7cc630e324e706c0a2bd405792283c4
diff --git a/third_party/libc++/BUILD.gn b/third_party/libc++/BUILD.gn
index 7915346..c03ebe0 100644
--- a/third_party/libc++/BUILD.gn
+++ b/third_party/libc++/BUILD.gn
@@ -14,17 +14,17 @@
       # libc++ wants to redefine the macros WIN32_LEAN_AND_MEAN and _CRT_RAND_S
       # in its implementation.
       "-Wno-macro-redefined",
+    ]
 
+    cflags_cc = [
       # We want to use a uniform C++ version across all of chromium, but
       # upstream libc++ requires C++20 so we have to make an exception here.
       # No other target should override the default -std= flag.
       "-std:c++20",
     ]
   } else {
-    cflags += [
-      "-fPIC",
-      "-std=c++20",
-    ]
+    cflags += [ "-fPIC" ]
+    cflags_cc = [ "-std=c++20" ]
   }
 
   defines = [ "_LIBCPP_BUILDING_LIBRARY" ]