From 9fc7b9bf7e485e3242c8f60b23e30aaca7ca44ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20=F0=9F=91=A8=F0=9F=8F=BD=E2=80=8D=F0=9F=92=BB=20Copl?= =?UTF-8?q?an?= Date: Fri, 26 Jul 2024 14:56:12 -0700 Subject: [PATCH] [libcxx][regex] add `[[__fallthrough__]]` to suppress fallthrough warning Summary: The diff #97926 is stacked on top of this patch because this file reports an error when enabling `-Wimplicit-fallthrough` in `-Wextra`. Test plan: ```sh $ time (mkdir build_runtimes && cd build_runtimes && set -x && CC=../build/bin/clang CXX=../build/bin/clang++ cmake -G Ninja ../runtimes -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' && ninja && bin/llvm-lit -sv ../libcxx/test/std/re ) ``` note: whether I put a `break;` or fallthrough, the tests pass anyways which is sus. --- libcxx/include/regex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/include/regex b/libcxx/include/regex index b814135121321..08aebc2266f5d 100644 --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -3921,7 +3921,7 @@ _ForwardIterator basic_regex<_CharT, _Traits>::__parse_character_escape( if (__hd == -1) __throw_regex_error(); __sum = 16 * __sum + static_cast(__hd); - // fallthrough + _LIBCPP_FALLTHROUGH(); case 'x': ++__first; if (__first == __last)