[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

dong jianqiang via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 19 03:01:47 PST 2023


================
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-default %s
+
+int f1(int a) {
+  switch (a) {                // expected-warning {{'switch' missing 'default' label}}
+    case 1: a++; break;
+    case 2: a += 2; break;
+  }
+  return a;
+}
----------------
dongjianqiang2 wrote:

See PR([#75900](https://github.com/llvm/llvm-project/pull/75900) )

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


More information about the cfe-commits mailing list