[clang-tools-extra] [clang-tidy] Move part of bugprone-unhandled-code-paths to a new check readability-trivial-switch (PR #198237)

Zeyi Xu via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 8 03:10:11 PDT 2026


================
@@ -0,0 +1,44 @@
+// RUN: %check_clang_tidy -std=c++98-or-later %s readability-trivial-switch %t
+
+void bad(int I) {
+  switch (I) {
+    // CHECK-MESSAGES: [[@LINE-1]]:3: warning: switch statement without labels has no effect [readability-trivial-switch]
----------------
zeyi2 wrote:

```suggestion
    // CHECK-MESSAGES: [[@LINE-1]]:3: warning: switch statement without labels has no effect
```

Same as other places :)

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


More information about the cfe-commits mailing list