Home | History | Annotate | Download | only in SemaCXX

Lines Matching defs:fallthrough

1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wimplicit-fallthrough %s
4 int fallthrough(int n) {
15 case 0: {// expected-warning{{unannotated fall-through between switch labels}} expected-note{{insert '[[clang::fallthrough]];' to silence this warning}} expected-note{{insert 'break;' to avoid fall-through}}
17 case 1: // expected-warning{{unannotated fall-through between switch labels}} expected-note{{insert '[[clang::fallthrough]];' to silence this warning}} expected-note{{insert 'break;' to avoid fall-through}}
19 case 3: // expected-warning{{unannotated fall-through between switch labels}} expected-note{{insert '[[clang::fallthrough]];' to silence this warning}} expected-note{{insert 'break;' to avoid fall-through}}
22 case 4: // expected-warning{{unannotated fall-through between switch labels}} expected-note{{insert '[[clang::fallthrough]];' to silence this warning}} expected-note{{insert 'break;' to avoid fall-through}}
25 case 5: // expected-warning{{unannotated fall-through between switch labels}} expected-note{{insert '[[clang::fallthrough]];' to silence this warning}} expected-note{{insert 'break;' to avoid fall-through}}
34 case 6: // expected-warning{{unannotated fall-through between switch labels}} expected-note{{insert '[[clang::fallthrough]];' to silence this warning}} expected-note{{insert 'break;' to avoid fall-through}}
55 [[clang::fallthrough]];
58 [[clang::fallthrough]];
63 [[clang::fallthrough]];
70 [[clang::fallthrough]];
182 [[clang::fallthrough]]; // expected-warning{{fallthrough annotation does not directly precede switch label}}
184 [[clang::fallthrough]]; // expected-warning{{fallthrough annotation in unreachable code}}
186 [[clang::fallthrough]]; // expected-warning{{fallthrough annotation does not directly precede switch label}}
188 [[clang::fallthrough]]; // expected-warning{{fallthrough annotation in unreachable code}}
190 [[clang::fallthrough]]; // expected-warning{{fallthrough annotation does not directly precede switch label}}
192 case 223: // expected-warning{{unannotated fall-through between switch labels}} expected-note{{insert '[[clang::fallthrough]];' to silence this warning}} expected-note{{insert 'break;' to avoid fall-through}}
193 [[clang::fallthrough]]; // expected-warning{{fallthrough annotation does not directly precede switch label}}
200 [[clang::fallthrough]]; // no warning here
203 [[clang::fallthrough]]; // no warning here
221 [[clang::fallthrough]]; // no warning here, this shouldn't be treated as unreachable code
232 // Fallthrough annotations in local classes used to generate "fallthrough
240 [[clang::fallthrough]]; // no diagnostics
252 // Fallthrough annotations in lambdas used to generate "fallthrough
260 [[clang::fallthrough]]; // no diagnostics
286 [[clang::fallthrough]]; // expected-error{{fallthrough annotation is outside switch statement}}
288 [[clang::fallthrough]] // expected-error{{fallthrough attribute is only allowed on empty statements}}
292 [[clang::fallthrough]]; // no warning here, correct target
294 [[clang::fallthrough]] // expected-error{{fallthrough attribute is only allowed on empty statements}}
297 [[clang::fallthrough]] // expected-error{{fallthrough attribute is only allowed on empty statements}} expected-note{{did you forget ';'?}}