1Backported from: <https://github.com/chromium/chromium/commit/f8f21fb4aa01f75acbb12abf5ea8c263c6817141.patch>
2Original author: Daniel Richard G <iskunk@gmail.com>
3
4diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
5index 5ee4905..6c500a0 100644
6--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
7+++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
8@@ -36,10 +36,13 @@ def generate_gperf(gperf_path, gperf_input, gperf_args):
9 # https://savannah.gnu.org/bugs/index.php?53028
10 gperf_output = re.sub(r'\bregister ', '', gperf_output)
11 # -Wimplicit-fallthrough needs an explicit fallthrough statement,
12- # so replace gperf's /*FALLTHROUGH*/ comment with the statement.
13- # https://savannah.gnu.org/bugs/index.php?53029
14- gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
15- ' FALLTHROUGH;')
16+ # so replace gperf 3.1's /*FALLTHROUGH*/ comment with the statement.
17+ # https://savannah.gnu.org/bugs/index.php?53029 (fixed in 3.2)
18+ if re.search(
19+ r'/\* C\+\+ code produced by gperf version 3\.[01](\.\d+)? \*/',
20+ gperf_output):
21+ gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
22+ ' [[fallthrough]];')
23 # -Wpointer-to-int-cast warns about casting pointers to smaller ints
24 # Replace {(int)(long)&(foo), bar} with
25 # {static_cast<int>(reinterpret_cast<uintptr_t>(&(foo)), bar}