1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wimplicit-fallthrough-per-function %s
4 int fallthrough(int n
) {
8 case 1: // expected-warning{{unannotated fall-through}} expected-note{{insert '[[clang::fallthrough]];' to silence this warning}} expected-note{{insert 'break;' to avoid fall-through}}
12 [[clang::fallthrough
]];
15 case 113: // expected-warning{{unannotated fall-through}} expected-note{{insert '[[clang::fallthrough]];' to silence this warning}} expected-note{{insert 'break;' to avoid fall-through}}
23 int fallthrough2(int n
) {
27 case 1: // no warning, as we didn't "opt-in" for it in this method
31 case 112: // no warning, as we didn't "opt-in" for it in this method
33 case 113: // no warning, as we didn't "opt-in" for it in this method
41 void unscoped(int n
) {
46 [[clang::fallthrough
]];