================
@@ -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;
+}
----------------
shafik wrote:
Might be worth adding a test case that shows that this warns even for
completely covered switches e.g. https://godbolt.org/z/zbqr6P5xc
https://github.com/llvm/llvm-project/pull/73077
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits