https://github.com/Keith-S-Thompson created 
https://github.com/llvm/llvm-project/pull/164709

Falling through a defaultless switch statement has well defined behavior.

Credit for noticing this problem goes to user "pozz" on comp.lang.c,
Message-ID: <[email protected]>

>From 283624cd251e86b00f2c02ecb040e29ee93cdfa0 Mon Sep 17 00:00:00 2001
From: Keith Thompson <[email protected]>
Date: Wed, 22 Oct 2025 13:32:00 -0700
Subject: [PATCH] [clang-tidy][NFC] Clarify switch-missing-default-case doc
 (#164699)

Falling through a defaultless switch statement has well defined
behavior.

Credit for noticing this problem goes to user "pozz" on comp.lang.c,
Message-ID: <[email protected]>
---
 .../checks/bugprone/switch-missing-default-case.rst           | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone/switch-missing-default-case.rst
 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone/switch-missing-default-case.rst
index 648c2c208a4ec..3ce862ff8afcc 100644
--- 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone/switch-missing-default-case.rst
+++ 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone/switch-missing-default-case.rst
@@ -9,8 +9,8 @@ on covering cases with non-enums where the compiler may not 
issue warnings.
 Switch statements without a default case can lead to unexpected
 behavior and incomplete handling of all possible cases. When a switch statement
 lacks a default case, if a value is encountered that does not match any of the
-specified cases, the program will continue execution without any defined
-behavior or handling.
+specified cases, the switch statement will do nothing and the program will
+continue execution without handling the value.
 
 This check helps identify switch statements that are missing a default case,
 allowing developers to ensure that all possible cases are handled properly.

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to