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

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 10 23:55:21 PDT 2024


================
@@ -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
+      [[__fallthrough__]];
----------------
frederick-vs-ja wrote:

Existing code uses `_LIBCPP_FALLTHROUGH();`.
```suggestion
      _LIBCPP_FALLTHROUGH();
```

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


More information about the libcxx-commits mailing list