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

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 01:02:47 PDT 2026


================
@@ -0,0 +1,36 @@
+.. title:: clang-tidy - readability-trivial-switch
+
+readability-trivial-switch
+==========================
+
+Finds trivial ``switch`` statements that can be written more clearly.
+
+Every ``switch`` statement should have at least two ``case`` labels other than a ``default`` label.
----------------
vbvictor wrote:

@EugeneZelenko, We are not enforcing 80-column limit anymore according to this
https://discourse.llvm.org/t/rfc-remove-80-column-limit-in-documentation-files/89678
https://llvm.org/docs/CodingStandards.html#source-code-width

> However, documentation files are not source code files, and instead of fitting into 80 columns, they must be formatted to one sentence per line. This way a change in the middle of a paragraph doesn’t cause unnecessary changes in subsequent lines, making it easier for reviewers to see what has changed when documentation is updated.

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


More information about the cfe-commits mailing list