[libcxx-commits] [libcxx] [libcxx] [regex] add `[[clang::fallthrough]]` to suppress fallthrough warning (PR #100821)

Max Coplan via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 26 15:03:17 PDT 2024


https://github.com/vegerot created https://github.com/llvm/llvm-project/pull/100821

The diff #97926 is stacked on top of this patch because this file reports an error when enabling `-Wimplicit-fallthrough` in `-Wextra`

>From eb83d32dcf26cf5a8f749400beaccf6688b9107d 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?= <mchcopl at gmail.com>
Date: Fri, 26 Jul 2024 14:56:12 -0700
Subject: [PATCH] [libcxx][regex] add [[clang::fallthrough]] to suppress
 fallthrough warning

---
 libcxx/include/regex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/include/regex b/libcxx/include/regex
index b814135121321..463fea1638454 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<regex_constants::error_escape>();
       __sum = 16 * __sum + static_cast<unsigned>(__hd);
-      // fallthrough
+    [[clang::fallthrough]];
     case 'x':
       ++__first;
       if (__first == __last)



More information about the libcxx-commits mailing list