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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Max Coplan (vegerot)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/100821.diff


1 Files Affected:

- (modified) libcxx/include/regex (+1-1) 


``````````diff
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)

``````````

</details>


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


More information about the libcxx-commits mailing list