You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
350 B

// To be used with cxx11-statement-attributes.cpp.
template<const int N>
int f(int n) {
switch (n * N) {
case 0:
n += 15;
[[clang::fallthrough]]; // This shouldn't generate a warning.
case 1:
n += 20;
case 2: // This should generate a warning: "unannotated fallthrough"
n += 35;
break;
}
return n;
}